Nie wiem czemu, ale na stronie nie działa mi lottery system, pokazuje się taki błąd:
Rozumiem, że albo coś nie wypełniłem w lottery.php albo nie wiem co, oto skrypt:
Proszę mi powiedzieć, co mam zrobić? ;s
PHP:
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 '0, lottery, item FROM lottery ORDER BY id DESC LIMIT 1' at line 1' in C:\xampp\htdocs\lottery.php:2 Stack trace: #0 C:\xampp\htdocs\lottery.php(2): PDO->query('0, lottery, ite...') #1 C:\xampp\htdocs\index.php(244): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\lottery.php on line 2
Rozumiem, że albo coś nie wypełniłem w lottery.php albo nie wiem co, oto skrypt:
PHP:
<?PHP
$lottery = $SQL->query('SELECT id, name, item FROM lottery ORDER BY id DESC LIMIT 1;');
foreach($lottery as $result) {
$main_content .= '<center><h1>Lottery</h1></center>
<center>Every X hours we will choose one player who will win random item!<br/>
Last Winner: <a href="?subtopic=characters&name='.urlencode($result['name']).'">'.$result['name'].'</a> Item: <i>'.$result['item'].'</i> Congratulations!</center>';
}
?>
Proszę mi powiedzieć, co mam zrobić? ;s