Total number of fields in a table : Table MetaData « MySQL Database « PHP






Total number of fields in a table

<?php

   mysql_connect("mysql153.secureserver.net","java2s","password");
   mysql_select_db("java2s");// databasename

   $fields = mysql_list_fields("java2s","Employee");// databasename and tablename
   echo "Total number of fields returned: ".mysql_num_fields($fields).".<br />";

?>


           
       








Related examples in the same category

1.Get table column flag
2.Get column data type
3.Get column name, type and max length
4.Get field length