[PHP-DEV] Re: From: Sterling Hughes (sterling <email protected>)
Date: 09/13/00

> I really hate to bother you Sterling but the zend_hash_next_index_insert first
argument is looking for a HashTable and not the array I'm passing. Here's is
some sample code I am using.
>
> PHP_FUNCTION(allegro_query) {
>
> zval **query, *entry;
> qres *unisql_result;
>
> if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1,&query)==FAILURE)
{
> WRONG_PARAM_COUNT;
> }
> convert_to_string_ex(query);
>
> if( (unisql_result = unisql_exec( (*query)->value.str.val )) ) {
>
> entry = (zval *)emalloc(sizeof(zval));
> array_init(entry);
> array_init(return_value);
>
>
add_index_string(tmp,0,unisql_result->colname[0],sizeof(unisql_result->colname[0
]));
>
add_index_string(tmp,1,unisql_result->colname[1],sizeof(unisql_result->colname[1
]));
> zend_hash_next_index_insert(return_value, &entry, sizeof(zval *),
NULL);
>

zend_hash_next_index_insert(return_value->value.ht, &entry, sizeof(zval *),
NULL);

   --or-- (same thing)

zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &entry, sizeof(zval *),
NULL);

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>