• 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!

Nie działa lottery system

Xavizo

New Member
Joined
Nov 4, 2009
Messages
44
Reaction score
0
Nie wiem czemu, ale na stronie nie działa mi lottery system, pokazuje się taki błąd:

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
 
Nie wiem czemu, ale na stronie nie działa mi lottery system, pokazuje się taki błąd:

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

proponuję zmianę kodowania znaków w pliku na utf-8 bez BOM*
 
Zmieniłem kodowanie na utf-8 bez bom i nadal nic, pokazuje takie coś:

"Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'malvaria update.lottery' doesn't exist' in C:\xampp\htdocs\lottery.php:2 Stack trace: #0 C:\xampp\htdocs\lottery.php(2): PDO->query('SELECT id, name...') #1 C:\xampp\htdocs\index.php(244): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\lottery.php on line 2"


#Sherlok
Akurat kolega mi to też zaproponował, ale i tak ci go dam.
 
Last edited:
Zmieniłem kodowanie na utf-8 bez bom i nadal nic, pokazuje takie coś:

"Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'malvaria update.lottery' doesn't exist' in C:\xampp\htdocs\lottery.php:2 Stack trace: #0 C:\xampp\htdocs\lottery.php(2): PDO->query('SELECT id, name...') #1 C:\xampp\htdocs\index.php(244): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\lottery.php on line 2"


#Sherlok
Akurat kolega mi to też zaproponował, ale i tak ci go dam, tylko nie mogę tego znaleźć gdzie bym ci tego reputa dał <lol>

http://otland.net/reputation.php?p=597866
 
hmm wg. mnie to nie masz tabeli lottery w bazie mal... update :p
 
Last edited:
Back
Top