Hi everyone,
I'm having a problem with a very simple script I'm trying to run.
I want to display the date one of the tables in my MySQL database was last updated.
This is the coding I'm using (obviously with my real username and password instead of the ****):
Code:
<?
$database="eliza-d_com";
$user="******";
$pass="******";
mysql_connect(localhost,$user,$pass);
mysql_select_db($database) or die( "Unable to select database");
$info = mysql_fetch_array(mysql_query("show table status from eliza-d_com like 'missy'"));
echo $info["Update_time"];
?>
But no matter what I try, I get the following error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site61/fst/var/www/html/datetest.php on line 21
I have tried several variations on this little script, and none work. I can connect to the database just fine, other queries I put in to test that, worked fine. If I leave off the fetch_array, the script executes fine too, with no errors. It just doesn’t display anything because I can’t seem to access the results of the query. You can see it in action here:
http://eliza-d.com/datetest.php
I have googled this for like 3 days now, but to no avail. All resources I found that mention how to do this, use the code I’m using. Even the PHP and MySQL Manuals instruct to do it this way. I have no idea what I’m doing wrong.
Any help with this would be very much appreciated!