Z?v?? Posted May 10, 2007 Share Posted May 10, 2007 This may be a shocker but...I'm getting an error on a cron file that came in one of the mods I regretfully bought from spotlightgaming. Heres the error I get when I run the cron manually... QUERY ERROR: 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 'AND list='turnedonpc'' at line 1 Query was SELECT * FROM turnonpc WHERE userid= AND list='turnedonpc' This is the query that is erroring... $q=$db->query("SELECT * FROM turnonpc WHERE userid=$userid AND list='turnedonpc'"); Quote Link to comment Share on other sites More sharing options...
Decepti0n Posted May 11, 2007 Share Posted May 11, 2007 Re: Cron Error whats the rest of it? Quote Link to comment Share on other sites More sharing options...
Z?v?? Posted May 11, 2007 Author Share Posted May 11, 2007 Re: Cron Error Heres the whole cron file... cron_virus.php <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; global $c; $q=mysql_query("SELECT * FROM turnonpc WHERE userid=$userid AND list='turnedonpc'",$c); if(mysql_num_rows($q)) { die("You have already turned on your pc today you can only do this once a day!"); $h->endpage(); } else { $db->query("INSERT INTO turnonpc values ($userid,'turnedonpc')"); header("Location:cron_virus.php"); exit; } if($ir['activexvirus'] > 1) { mysql_query("UPDATE users set activexvirus=activexvirus-1 WHERE activexvirus>0",$c); } if($ir['activexvirus']==1) { $db->query("INSERT INTO inventory VALUES('',8008,$userid,1,0)"); $db->query("UPDATE users set activexvirus=0 WHERE activexvirus>0"); event_add($ir['userid'],"You have completed programing your Active X Virus it's on your items.",$c); } if($ir['macrovirus'] > 1) { $db->query("UPDATE users set macrovirus=macrovirus-1 WHERE macrovirus>0"); } if($ir['macrovirus']==1) { $db->query("INSERT INTO inventory VALUES('',8007,$userid,1,0)"); $db->query("UPDATE users set macrovirus=0 WHERE macrovirus>0"); event_add($ir['userid'],"You have completed programing your Macro Virus it's on your items.",$c); } if($ir['bootvirus'] > 1) { mysql_query("UPDATE users set bootvirus=bootvirus-1 WHERE bootvirus>0",$c); } if($ir['bootvirus']==1) { mysql_query("INSERT INTO inventory VALUES('',8006,$userid,1,0)",$c); mysql_query("UPDATE users set bootvirus=0 WHERE bootvirus>0",$c); event_add($ir['userid'],"You have completed programing your Boot Virus it's on your items.",$c); } if($ir['tunnellingvirus'] > 1) { mysql_query("UPDATE users set tunnellingvirus=tunnellingvirus-1 WHERE tunnellingvirus>0",$c); } if($ir['tunnellingvirus']==1) { mysql_query("INSERT INTO inventory VALUES('',8005,$userid,1,0)",$c); mysql_query("UPDATE users set tunnellingvirus=0 WHERE tunnellingvirus>0",$c); event_add($ir['userid'],"You have completed programing your Tunnelling Virus it's on your items.",$c); } if($ir['simplevirus'] > 1) { mysql_query("UPDATE users set simplevirus=simplevirus-1 WHERE simplevirus>0",$c); } if($ir['simplevirus']==1) { mysql_query("INSERT INTO inventory VALUES('',8003,$userid,1,0)",$c); mysql_query("UPDATE users set simplevirus=0 WHERE simplevirus>0",$c); event_add($ir['userid'],"You have completed programing your Simple virus it's on your items.",$c); } if($ir['polymorphicvirus'] > 1) { mysql_query("UPDATE users set polymorphicvirus=polymorphicvirus-1 WHERE polymorphicvirus>0",$c); } if($ir['polymorphicvirus']==1) { mysql_query("INSERT INTO inventory VALUES('',8004,$userid,1,0)",$c); mysql_query("UPDATE users set polymorphicvirus=0 WHERE polymorphicvirus>0",$c); event_add($ir['userid'],"You have completed programing your Polymorphic virus it's on your items.",$c); $h->endpage(); exit; Quote Link to comment Share on other sites More sharing options...
Z?v?? Posted May 14, 2007 Author Share Posted May 14, 2007 Re: Cron Error Any ideas on how to fix this? Quote Link to comment Share on other sites More sharing options...
hamster01 Posted May 14, 2007 Share Posted May 14, 2007 Re: Cron Error Someone is retarted. As the Server that runs the cron does not have an userid :| :lol: Quote Link to comment Share on other sites More sharing options...
Z?v?? Posted May 14, 2007 Author Share Posted May 14, 2007 Re: Cron Error Spotlightgaming is the one that made the file lol. Whats the fix for it? Quote Link to comment Share on other sites More sharing options...
hamster01 Posted May 14, 2007 Share Posted May 14, 2007 Re: Cron Error Umm.. I know slg mad eit.. but that isnt a cron :| If it's supposed to be the one who made it is an complete idiot. You cant have $userid, die(); and stuff like that on an automated file. Quote Link to comment Share on other sites More sharing options...
Z?v?? Posted May 14, 2007 Author Share Posted May 14, 2007 Re: Cron Error Ya, thats the cron lol. Can you rewrite it for me so it works as a cron. Quote Link to comment Share on other sites More sharing options...
hamster01 Posted May 14, 2007 Share Posted May 14, 2007 Re: Cron Error No. I dont have time for this :( And im not going to help spotlightgaming's script, just nopw he will say i stole it >:( Quote Link to comment Share on other sites More sharing options...
Z?v?? Posted May 14, 2007 Author Share Posted May 14, 2007 Re: Cron Error Ok, I'm now payin $2 to anyone that rewrites this for me so it works as a cron. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.