Jump to content


Checking what fields are in an empty table

  • Please log in to reply
1 reply to this topic

#1 OriginalSunny

  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 26 February 2006 - 08:12 PM


I have created a number of tables and populated the majority of them. There are however some tables i have not populated with data. I can check what fields are in the populated tables using the command:

select * from tablename;

However if i do this in an empty tables it obviously says "empty set". How do i find out what fields i have created in the table??


#2 shoz

  • Staff Alumni
  • Advanced Member
  • 600 posts

Posted 26 February 2006 - 11:27 PM

[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--]SHOW COLUMNS FROM tablename [!--sql2--][/div][!--sql3--]
while ($row = )
    echo $row['Field'];

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users