ArizonaJohn Posted August 5, 2009 Share Posted August 5, 2009 Hello, I think the query below returns the names of the last 25 tables added to the MySQL database "bookfeather." How would I print these 25 table names out in a 1-column, 25-row table, with the table names descending from the most recently created on top down to the 25th-most recently created on the bottom? Thanks in advance, John $index = mysql_query("select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='bookfeather` order by CREATE_TIME desc limit 25"); Link to comment https://forums.phpfreaks.com/topic/168877-table-names-in-a-chronologically-descending-table/ Share on other sites More sharing options...
smerny Posted August 5, 2009 Share Posted August 5, 2009 Hello, I think the query below returns the names of the last 25 tables added to the MySQL database "bookfeather." How would I print these 25 table names out in a 1-column, 25-row table, with the table names descending from the most recently created on top down to the 25th-most recently created on the bottom? Thanks in advance, John $index = mysql_query("select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='bookfeather` order by CREATE_TIME desc limit 25"); echo "<table>"; $index = mysql_query("select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='bookfeather` order by CREATE_TIME desc limit 25"); while ($row = mysql_fetch_array($index)) { echo "<tr><td>".$row['TABLE_NAME']."</td></tr>"; } echo "</table>"; although with one column you don't really need to use tables Link to comment https://forums.phpfreaks.com/topic/168877-table-names-in-a-chronologically-descending-table/#findComment-891013 Share on other sites More sharing options...
ArizonaJohn Posted August 5, 2009 Author Share Posted August 5, 2009 It says: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource Link to comment https://forums.phpfreaks.com/topic/168877-table-names-in-a-chronologically-descending-table/#findComment-891023 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.