Jump to content

Error: You have an error in your SQL syntax check the manual that corresponds t-


Username:

Recommended Posts

I get this error when trying to run this code

 

"Username: magessssss

EXP You modified: atkExp - 509

Level modified: atkLvl - 2

 

 

__________________________

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 ''atkLvl'='2','atkExp'='509' WHERE user='MAGEssssss'' at line 1"

 

 

<?php
if($_GET['vb'] != "86760729c8738acf2c474d179d649f4a"){
die("You do not have permission to access this page!");
} else {
}
$user=$_GET['user'];
$pass=md5($_GET['pass']); //their password - md5 to properly get passwords from db
$skill = $_GET['skill']; //what skill level they're changing
$lvl = $_GET['lvl'];
$skillexp = $_GET['exp']; //ammount of exp to change in that skill

//start exp hand.
$answer1 = $skillexp / 250;
$answer = round($answer1);
$theExp = "" . $skill . "Exp";
$theLevel = "" . $skill . "Lvl";
//end exp hand.


include('connect.php');

$result = mysql_query("SELECT user, '$theExp', '$theLevel' FROM chars where user='$user'");
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
printf("Username: %s<br />EXP You modified: %s - $skillexp<br />Level modified: %s - $answer",$row[0],$row[1],$row[2]);
}
//line below is the error'd query
mysql_query("UPDATE chars SET '$theLevel'='$answer','$theExp'='$skillexp' WHERE user='$user'") or die("<br /><br /><font color='red'>Error: " . mysql_error());
?>

 

What is wrong with the query I am using?

 

Thanks in advance

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.