Re: is the array from mysql_fetch_array really an array (or does it just pretend ) ???? Creating an array with mysql table fieldnames in it....
| From: | Daniel Convissor | Date: | Tue, 25 Jul 2000 13:22:02 +0000 |
| Subject: | Re: is the array from mysql_fetch_array really an array (or does it just pretend ) ???? Creating an array with mysql table fieldnames in it.... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8030@lists.php.net to get a copy of this message | ||
Hi Nick:
> while ($fieldnames=$check->fetch_fields())
> {
> echo "this is a fieldname: $fieldnames[name]";
> $fields[]=$fieldnames[name];
> }
>
> fetch_fields is a function in a class which goes as follows:
>
> function fetch_fields()
> {
> return mysql_fetch_field($this->Query_ID);
> }
Here's what I do:
$FieldCount = mysql_num_fields($this->Query_ID);
for ($Counter = 0; $Counter < $FieldCount; $Counter++) {
$fields[] = mysql_field_name($this->Query_ID, $Counter);
}
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
More than just answers. Solutions. (SM)
http://www.analysisandsolutions.com/
4015 7 Av #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409