Thanks again but I still get the same error. I'm sure the DB connection is good as I can use the original query with no problems. I'm going to post the entire code also. Sorry to be of so much trouble.
Quote:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/*****/public_html/pagevisE.php on line 13
|
PHP Code:
<?php
#!/usr/lib/php
// Creates Text Input for PageVisualize
$host = "localhost";
$mysql_user = "*****";
$mysql_password = "*****";
$sdatabase = "******";
$slink = mysql_connect("$host", "$mysql_user", "$mysql_password") or die('Database Connection Failed. Wait a moment.');
mysql_select_db ("$sdatabase", $slink);
$file = fopen("TestPhpD.txt", "w");
//$urls = mysql_query("SELECT linkid,linkurl FROM adv_links ORDER by linkid ASC");
$urls = mysql_query("SELECT linkid,linkurl FROM adv_links ORDER by linkid ASC WHERE dateline > " . (TIMENOW - (2 * 24 * 60 * 60)));
while ($urlrow = mysql_fetch_array($urls)) {
fwrite($file," ");
fwrite($file, $urlrow[1]);
fwrite($file, " | ");
fwrite($file," ");
fwrite($file, $urlrow[0]);
fwrite($file," \n");
}
fclose($file);
?>