Jump to content
MakeWebGames

Cron Error


Z?v??

Recommended Posts

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'");
Link to comment
Share on other sites

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;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...