I've been working at this for quite a while now and cannot figure out what the error it..I am trying to insert something into the database and it keeps telling me this:
errorYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show SET perf = '5', showname = 'DNE', showid = '2511', totalsta' at line 1
This is the section of the coding thats giving me the problems..
errorYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show SET perf = '5', showname = 'DNE', showid = '2511', totalsta' at line 1
This is the section of the coding thats giving me the problems..
PHP:
$id = $_GET['id'];
$fetchedplayer = mysql_query("SELECT * FROM shows WHERE id = '$id'") or die(mysql_error());
$fetchedplayer = mysql_fetch_array($fetchedplayer);
$showname = $fetchedplayer['showname'];
$id = $fetchedplayer['id'];
$fee = $fetchedplayer['fee'];
$hosterid = $fetchedplayer['hosterid'];
$showname = $showname;
$showid = $showid;
mysql_query("UPDATE players SET money=money-$fee WHERE id='$sessid'") or die(mysql_error());
mysql_query("UPDATE players SET money=money+$fee WHERE id='$hosterid'") or die(mysql_error());
$perf = mt_rand(1,15);
$petid = trim($_POST['petid']);
$fetchedpet = mysql_query("SELECT * FROM pets WHERE petid = '$petid'") or die(mysql_error());
$fetchedpet = mysql_fetch_array($fetchedpet);
$petname = $fetchedpet['petname'];
$totalstats = $fetchedpet['totalstats'];
$petid = $fetchedpet['petid'];
$perf = mt_rand(1,15);
$petname = $petname;
$totalstats = $totalstats;
$petid = $petid;
mysql_query("INSERT INTO show SET
perf = '$perf',
showname = '$showname',
showid = '$id',
totalstats = '$totalstats',
petname = '$petname',
petid = '$petid'") or die ('error' . @mysql_error());
echo "<br>$petname was entered into $showname for a fee of $$fee.<BR><BR>";
};