mysql_query problems...
Posted: Fri Mar 20, 2009 11:01 am
this is my new code, its on line 87:
This is the error i recieve:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
here is my whole code:
Code: Select all
mysql_query("DELETE FROM findamatch WHERE NOW() - 030000 > $timestamp") or die(mysql_error());This is the error i recieve:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
here is my whole code:
Code: Select all
<?
include("./includes/incglobal.php");
global $config;
$out[body].="<center>
<br />
<table border='0' width='95%' cellspacing='1' cellpadding='2' bgcolor='#000000'>
<tr bgcolor='$config[altcolora]'>
<td colspan='7' background='$config[bg]'>
<B> Ready to Play</B>
</td>
</tr>
<tr bgcolor='$config[altcolorb]'>
<td background='/images/td_bg2.gif'>
<B><center>Challenger</B>
</td>
<td background='/images/td_bg2.gif'>
<B><center>Game</B>
</td>
<td background='/images/td_bg2.gif'>
<B><center>Rules</B>
</td>
<td background='/images/td_bg2.gif'>
<B><center>Max Bet</B>
</td>
<td background='/images/td_bg2.gif'>
<B><center>Challenge</B>
</td>
<td background='/images/td_bg2.gif'>
<B>
<center>Contact</B>
</td>
</tr>";
$fam=mysql_query("SELECT id,clan,rules,month,day4,year,hour,min,ampm,timezone,teamid,ladder,maxbet,aim,email,yim,timestamp FROM findamatch ORDER BY timestamp");
while(list($id,$clan,$rules,$month,$day4,$year,$hour,$min,$ampm,$timezone,$teamid,$ladder,$maxbet,$aim,$email,$yim,$timestamp)=mysql_fetch_row($fam)){
$icq2 = "<img src='./images/icq.gif' align='bottom'>";
$aim2 = "<a href='aim:goim?screenname=$aim&message=Hello+Are+you+there?'><img src='./images/aim.gif' border='0'></a>";
$email2 = "<a href='mailto:$email'><img src='./images/email.gif' border='0'></a>";
$edit = "<form method='post' style='margin-bottom: 0'><input type='hidden' name='find[teamid]' value='$teamid'>
<input type='hidden' name='act' value='edit'><input type='hidden' name='pid' value='$id'><input type='image' src='./images/edit.gif' name='submit'></form>";
$yim2 = "<a href='http://edit.yahoo.com/config/send_webmesg?.target=$yim&.src=pg'><img src='./images/yahoo.gif' border='0' align='absmiddle'></a>";
if ($aim == "") {
$aim2 = "";
}
if ($aim == "0") {
$aim2 = "";
}
if ($yim== "") {
$yim2 = "";
}
if ($yim == "0") {
$yim2 = "";
}
$out[body].="
<tr bgcolor='$config[altcolora]' align='center'>
<td><center><a href='./stats.php?account=$teamid'>$clan</a></td>
<td><center>$ladder</td>
<td><center>$rules</td>
<td><center>$$maxbet</td>
<td><center><a href='./challenge.php?login[cid]=$teamid'>Challenge</a></td>
<td><table border='0'>
<tr><td align='center'>
<center> $email2 <br><b>PS3 Name:</b> <a href='./stats.php?account=$teamid'>$aim</a><br><b>XBox360 Name:</b> <a href='./stats.php?account=$teamid'>$yim</a></center></td></tr>
</table></td>
</tr>
";
$count++;
}
mysql_query("DELETE FROM findamatch WHERE NOW() - 030000 > $timestamp") or die(mysql_error());
if($count == 0){
$out[body].="
<tr bgcolor='$config[altcolora]'>
<td colspan='7'>
<center>There is currently nobody looking for a game.</center>
</td>
</tr>";
}
$out[body].="</table>";
$out[body].="<br /><br />";
include("$config[html]");
?>