On Sun, 2 Feb 2003, Davy Obdam wrote: > Hi ppl, > > I have a problem that probably very simple, but i cannot figure it out > right now.... > I need to get the field names of my database. I have a query like select > * from books and now i wanna have both the result and the field name. I > have been trying with mysql_field_name, but not succesfully... > > $i = 0; > for($a=0; $a < sizeof(mysql_field_name($db->sqlResult, $i)); $a++) { > echo mysql_field_name($db->sqlResult, $i)."<br />"; > $i++; > } > > Can anyone help me please.. Your help is greatly appreciated;-)
Please read the example in the manual as well as the user contributed notes. They show how to do this: http://www.php.net/mysql_field_name See also: mysql_num_fields() Regards, Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php