• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

PHP bug sql t.t

Kask

Banned User
Joined
Jan 3, 2008
Messages
376
Reaction score
1
i dont know how to solve this bug...
Code:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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 'desc,rewards = level' at line 1' in I:\xampp\htdocs\quest\quest.php:15 Stack trace: #0 I:\xampp\htdocs\quest\quest.php(15): PDO->query('SELECT * FROM z...') #1 I:\xampp\htdocs\index.php(87): include('I:\xampp\htdocs...') #2 {main} thrown in I:\xampp\htdocs\quest\quest.php on line 15
line 15
PHP:
$show = $SQL->query('SELECT * FROM z_quest_sytem WHERE level,desc,rewards = level');
SQL TABLE:
Code:
CREATE TABLE IF NOT EXISTS `z_quest_sytem` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `level` char(50) DEFAULT NULL,
  `desc` char(50) DEFAULT NULL,
  `rewards` char(15) DEFAULT NULL,
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=41 ;
I dont know much from MySQL >.< i agree all critic :D
rep+ who's help me :D
 
Last edited:
PHP:
$show = $SQL->query('SELECT * FROM z_quest_sytem WHERE level,desc,rewards = \'level\'');

And if your trying to use a php variable use:

PHP:
$show = $SQL->query('SELECT * FROM z_quest_sytem WHERE level,desc,rewards = '.$level);
 
Back
Top