I wrote a cron tab that updates an external text file and I would like the same cron to update a MySql database. How can I pass the array?
This works believe it or not, but it does not do what I need it to do. This script only places all of the same contents that would go into the text file into a single field of the MySql database. I need to be able to let a user know if they have been selected by posting a graphic in the main page. I tried winit like \'%$uid%\' and everybody was a winner. I need to pass the array to make this work.
<?
$today = date(\"F j, Y, g:i a\");
include (\"config.inc.php\");
ob_start($blue);
$sql = \"select distinct * from vipcustomer order by Rand() limit 12\";
$namo = mysql_query($sql);
$r = mysql_fetch_array($namo);
do{
printf(\"<center>%s %s - %s</center>\n\", $r[\"first_name\"], $r[\"last_name\"], $r[\"custid\"]);
} while ($r = mysql_fetch_array($namo));
echo $today;
$string = ob_get_contents($blue);
$filename =\"win.txt\";
$handle= fopen($filename,\'w\');
fputs($handle, $string);
fclose($handle);
$killit = \"DELETE FROM vipwin\";
$result = mysql_query($killit);
$winsome = \"INSERT INTO vipwin (custid,winit,win_time) VALUES (\'$a\',\'$string\',\'$today\')\";
$result = mysql_query($winsome);
?>
Thank You!