dennismonsewicz Posted September 23, 2009 Share Posted September 23, 2009 Is there anyway in PHP to retrieve the date in which a mysql table was created? Quote Link to comment Share on other sites More sharing options...
cahrehn Posted September 23, 2009 Share Posted September 23, 2009 show databases gives me the databases I've created, as well as "information_schema". In that database, there's a "tables," uhm, table. It's got info about all the databases and their tables, including a column called "create_time", which will tell you what you want. Quote Link to comment Share on other sites More sharing options...
mattal999 Posted September 23, 2009 Share Posted September 23, 2009 Use this command instead: <?php $query = mysql_query("SHOW tablename STATUS") or die(mysql_error()); print_r(mysql_fetch_array($query)); ?> Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted September 23, 2009 Author Share Posted September 23, 2009 here is the code I am using: $t = mysql_query("SHOW users STATUS")or die(mysql_error()); print_r($t); This is the error I am getting: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'users STATUS' at line 1 Quote Link to comment Share on other sites More sharing options...
mattal999 Posted September 23, 2009 Share Posted September 23, 2009 Sorry should be: $t = mysql_query("SHOW TABLE STATUS LIKE 'users'")or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted September 23, 2009 Author Share Posted September 23, 2009 hmmm now I am getting: Resource id #4 when I print_r the mysql_query query code $t = mysql_query("SHOW TABLE STATUS LIKE 'users'")or die(mysql_error()); print_r($t); Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted September 23, 2009 Share Posted September 23, 2009 hmmm now I am getting: Resource id #4 when I print_r the mysql_query You're clearly having a bad hair day $t = mysql_query("SHOW TABLE STATUS LIKE 'users'")or die(mysql_error()); while (($r = mysql_fetch_array($t)) !== false) { print_r($r); } Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted September 23, 2009 Author Share Posted September 23, 2009 lol dude you have no idea!!! tks! that worked! Quote Link to comment 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.