First I want to say thanks to everyone who helped me figure out how to update my links list with crontab!
Now... I can get my query to work, I have crontab set and working with a simple fwrite() script, BUT when I want to loop my query results within the fwrite() function I get:
while ( = mysql_fetch_array(Resource id #2)) {
} SITE TITLE IN
All I want to do is grab the 10 top rated sites from a mySQL database and write the results to a file called topten.php. Everything worked great until I added the while loop. Here is the code I used:
<?php
// database connection and SQL query go here
// need help with this part...
$topten = fopen("/pathtofile/topten.php", "w");
fwrite($topten, "<TABLE BORDER=1>
<TR><TH>SITE TITLE</TH><TH>IN</TH></TR>
while ($row = mysql_fetch_array($sql_result)) {
<TR><TD><A HREF=\"$row[SITE_URL]\">$row[SITE_TITLE]</A></TD><TD>$row[SITE_IN]</TD></TR>
}
</TABLE>
");
fclose($topten);
// end of part I need help with
// free resources etc.
?>
I want to set this to run every hour using crontab. Anyone know what I'm doing wrong in the code above?
Many thanks!!!
Rich S.