Display mysql table datatype with PHP

Free Scripts :: PHP :: PHP and Mysql :: Display mysql table datatype with PHP

Author: Salman Javaid

Website: http://www.salman.be

  1. How to display mysql table field types.
  2. Show all mysql fielddatatypes with php.
  3. List datatypes of mysql table fields.

This script list all mysql table's field types.

Script

$i=0;
$sql = mysql_query("select * from products");
while( $i < mysql_num_fields($sql))
{
    echo mysql_field_type($sql, $i)  .  ', ';
    $i++;
}

Output

int, string, blob, date, time

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.