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

  1. How to display all mysql table field names.
  2. Show all mysql table field name with php.
  3. 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

Comments

No comments. Be the first one.

Leave a comment

Full Name*
Comments*
Security Code*

Our Partners

Getty Icons  Salman Creations
Free High Quality Images  Learn Free Languages 
Opal Hosting  R-Tech Solutions
  • Submit a Script

    Click here to submit your script.