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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
softsolvers
Forum Commoner
Posts: 75
Joined: Fri Feb 13, 2004 4:26 am
Location: India

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

Post 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
tylerdurden
Forum Commoner
Posts: 66
Joined: Mon Jul 28, 2003 11:52 am
Location: Austria

Post 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.
Post Reply