Jump to content

Table Names in a Chronologically descending table


ArizonaJohn

Recommended Posts

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");

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.