Hello all,
I need a very complex array from a mysql-statement like DB::getAssoc but more
complex.
In the time of mysql_fetch_row, I don't know, is the next data strings only or
must I fetch a next array in this branch or part of branch.
With this function I get all data for OOHForm + html-field-titles, help-text,
SQL-update-, SQL-select string and so on.
The database is very big and complex.
My Problem is, (I think so), I need an array of pointers for the field_array.
If I use strings, I get x times the last data why I use the same keys every
times.
I have tested many ways but now I'am tired to test more.
Please help me.
Here is a part of my code(it dosen't work I know).
zval **x_fname, **x_fvalue;
zval *feldname_C, *feldvalue_C, *field_array;
MYSQL_ROW s_row;
(...array_init ..)
....CONNECT ... SELECT an so on ...
while (s_row = mysql_fetch_row(s_mysql_res)) {
key = s_row[0]; // name of the branch
for (z = 0; z < fields; z++) {
add_next_index_string(feldname_C, fieldinfo[z].name, 1);
add_next_index_string(feldvalue_C, s_row[z], 1);
z1++;
}
for (z = z2; z < z1; z++) {
zend_hash_index_find(Z_ARRVAL_P(feldname_C), z, (void **)&x_fname );
zend_hash_index_find(Z_ARRVAL_P(feldvalue_C), z, (void **)&x_fvalue );
zend_hash_add(Z_ARRVAL_P(felder_array), x_fname, sizeof(zval *), \
x_finhalt, sizeof(zval *), NULL);
}
z2 = z1;
zend_hash_add(Z_ARRVAL_P(return_value),key , strlen(key)+1 , \
&felder_array, sizeof(zval *), NULL);
}
Thanks
Johannes G. Arlt
[EMAIL PROTECTED]
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php