Page 1 of 1

can i view the field definition of sql table by php code

Posted: Sat Feb 21, 2004 12:16 am
by softsolvers
hello friends
i want to view the field discription of mysql table in my php form ,how can i do this,is there any function to do this
lokking for your suggestion

Posted: Sat Feb 21, 2004 9:57 am
by tylerdurden
You can use this:

Code: Select all

$result = mysql_query("DESCRIBE tablename");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {

echo "<pre>";
print_r($row);
echo "</pre><br>";
&#125;
And continue from there.