Re:

From: Date: Wed, 13 Sep 2000 19:00:54 +0000
Subject: Re:
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-33205@lists.php.net to get a copy of this message
> 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);

« previous php.dev (#33205) next »