Display all mysql table fields with PHP
Free Scripts :: PHP :: PHP and Mysql :: Display all mysql table fields with PHP
Author: Salman Javaid
Website: http://www.salman.be
Website: http://www.salman.be
- 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 list 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




