- How to display all mysql table field names.
- Show all mysql table field name with php.
- List all field names of mysql table.
This script lists all mysql table field names.
Script
$i=0;
$sql = mysql_query("select * from products");
while( $i < mysql_num_fields($sql)){
echo mysql_field_name($sql, $i) . ', ';
$i++;
}
Output
id, product, ,item_code, category, price

Leave A comment
Email address is optional and will not be published. Only add email address if you want a reply from blog author.
Please fill required fields marked with *