<? #!/usr/local/bin/php -q ?>
<?
require_once dirname(__FILE__) . '/../../' . 'connections/dbconnect.php';
require_once dirname(__FILE__) . '/../../' . 'includes/page-id.php';
$drop="DROP table if exists SiteMonitor";
$dropTable=mysql_query($drop);
// create table
$create = mysql_query("CREATE TABLE SiteMonitor (
ID INT(11)
, PageID VARCHAR(255) NULL
, Name VARCHAR(255) NULL
, Link VARCHAR(255) NULL
, Image VARCHAR(255) NULL
, ImageSmall VARCHAR(255) NULL
, Room VARCHAR(255) NULL
, Players INT(11) NULL
, Game VARCHAR(255) NULL
, Ticket VARCHAR(11) NULL
, Jackpot DECIMAL(11,2) NULL
, Progressive DECIMAL(11,2) NULL
, NextGame INT(11) NULL
)
ENGINE=MEMORY;");
//declare pageID as first variable so can extract other datafrom main db in individual monitors
$pageID = "xx-siteID-xx";
$xml = @simplexml_load_file("http://address.of.xml.file");
if ($xml) {
//get the fixed values of the bingo room from the pageID
$info = mysql_query("SELECT * FROM SiteTable WHERE PageID='".$pageID."'")
or die(mysql_error());
$infoNumRows = mysql_num_rows($info);
$pageID=mysql_result($info,0,"PageID");
$name=mysql_result($info,0,"Name");
$link=mysql_result($info,0,"link");
$image=mysql_result($info,0,"Image");
$imageSmall=mysql_result($info,0,"ImageSmall");
foreach($xml->ROOM as $rooms ) {
$room1 = $rooms->attributes()->name;
$players = $rooms->attributes()->currentplayers;
$ticket = $rooms->attributes()->cardvalue;
$game = $rooms->attributes()->roomtype;
$jackpot = $rooms->attributes()->jackpot;
$progressive = $rooms->attributes()->progressive;
$nextGame = $rooms->attributes()->seconds;
//character substitution and data formatting takes place here
mysql_query("INSERT INTO SiteMonitor (
PageID,
Name,
Link,
Image,
ImageSmall,
Room,
Players,
Game,
Ticket,
Jackpot,
Progressive,
NextGame)
VALUES (
'$pageID',
'$name',
'$link',
'$image',
'$imageSmall',
'$room1',
'$players',
'$game',
'$ticket',
'$jackpot',
'$progressive',
'$nextGame')")
or die(mysql_error());
}
}
?>
something isn't working under the cron job which does work fine manually, but it's not like I can see any errors since even in the email it sends out.
the cron job line I was given by the host (which does execute fine) is
/usr/local/bin/php -q -f /home/xx-account-xx/public_html/monitor/includes/create-table1.php
im not sure what the -q and -f means?