skidmark10 Posted August 23, 2011 Share Posted August 23, 2011 Hello, Does anyone know the php code to display mysql table names? Quote Link to comment https://forums.phpfreaks.com/topic/245464-how-to-display-column-names-in-a-mysql-table-using-php/ Share on other sites More sharing options...
ebmigue Posted August 23, 2011 Share Posted August 23, 2011 You can query the INFORMATION_SCHEMA database, much like how you would query your own database. Google "information_schema mysql". Hope it helps. Quote Link to comment https://forums.phpfreaks.com/topic/245464-how-to-display-column-names-in-a-mysql-table-using-php/#findComment-1260746 Share on other sites More sharing options...
The Little Guy Posted August 24, 2011 Share Posted August 24, 2011 This will display each table on the page: $sql = mysql_query("show tables"); while($row = mysql_fetch_array($sql)){ echo $row[0]."<br>"; } Quote Link to comment https://forums.phpfreaks.com/topic/245464-how-to-display-column-names-in-a-mysql-table-using-php/#findComment-1261557 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.