without going into long details, the following script has been working for years. I had to make some changes due to the parent company removing some fields. Now its not working - its not giving me an error, its just not populating the db. i put affected rows to watch, and it yeilds a big fat zero.
i had to remove 2 fields - and as you can see, they balance out (should be 31 fields now). worked last night, had to make some more changes this morning, and boom - not working
I really hate to change this to a bind param, as this was working just fine for what I want it to do.
Please help a blind man LOL I am sure its simple, as I have looked at it too long
foreach($game->game as $g)
{
echo 'Adding: '.$g->gamename.'<br/>';
try
{
$sql = "
INSERT INTO games
(
gameid,gamename,family,familyid,productid,genreid,allgenreid,shortdesc,meddesc,longdesc,
bullet1,bullet2,bullet3,bullet4,bullet5,foldername,price,hasdownload,macgameid,
hasvideo,hasflash,hasdwfeature,dwwidth,dwheight,releasedate,gamesize,
pc_sysreqos,pc_sysreqmhz,pc_sysreqmem,pc_sysreqdx,pc_sysreqhd
)
VALUES
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
$query = $db->prepare($sql);
$query->execute(array(
$g->gameid, $g->gamename, $g->family, $g->familid, $g->productid, $g->genreid, $g->allgenreid, $g->shortdesc,
$g->meddesc, $g->longdesc, $g->bullet1, $g->bullet2, $g->bullet3, $g->bullet4, $g->bullet5, $g->foldername,
$g->price, $g->hasdownload,$g->macgameid, $g->hasvideo, $g->hasflash, $g->hasdwfeature,$g->dwwidth, $g->dwheight,
$g->releasedate,$g->gamesize, $g->pc_sysreqos,$g->pc_sysreqdx,$g->pc_sysreqmhz,$g->pc_sysreqmem,$g->pc_sysreqdx,$g->pc_sysreqhd
));
echo 'affected rows: '.$query->rowcount().'<br/>';
}
catch(PDOException $e)
{
echo "Game insertion error<br/>".$e->getMessage();
}
}// loop through xml