i'm stuck on getting the field names of a table and stored on the result set, as well as when we use select .... query on php.
Please help me to do this. Thank you
To get field names as well as the content you user the mysql_field_name()function.
eg
$sql = "select * from table"; $res = mysql_query($sql);
$field_name_one = mysql_field_name($sql, 0); $field_name_two = mysql_field_name($sql, 1);$field_name_three = mysql_field_name($sql, 2);
get the picture?
Steve Obbayi
oops slight mistake the lines in the previous thread that read
$field_name_one = mysql_field_name($sql, 0);
should be changed to..
$field_name_one = mysql_field_name($res, 0);
so as to read use $res rather than $sql