Hello everyone,
I have a bunch of php scripts working well with mySQL on my site, but I just wrote one and I'm getting an annoying error. The code is simple:
$url = "'".$url."'";
//Get last modification date from database
$result = mysql_query("SELECT last_modified from static_pages WHERE url = $url",$db) or die("Cannot select last_modified from static_pages");
And the error message is the dreaded:
Warning: 0 is not a MySQL link index in /home/paralla/public_html/xs/includes/header_top.php3 on line 19
Cannot select last_modified from static_pages
Now what the heck does this mean? I put single quotes around $url, which is passed into the function, and this SELECT works fine in TELNET (returns 1 row, with a date). I'm accessing that like this:
$db_mod_date = mysql_result($result,0);
Which is immaterial because the script is failing on the SELECT. Now what does this mean? Obviously the select is failing, but I have no idea why.
Thanks a lot for your help.