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

System loterii

sessam

New Member
Joined
Dec 28, 2009
Messages
55
Reaction score
1
Hiho. Wgrałem właśnie otlandowski system loterii.

http://otland.net/f82/lottery-system-44496/

Wszystko ładnie pięknie śmiga, ale mam mały problemik z dodaniem tego na stronę główną. Dodaje kod

<?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>';
}
?>

Lecz nic się nie pokazuje. Dokładnie taki efekt.
beztytuuxaj.png


Próbowałem także tak

<?PHP
$lottery = $SQL->query('SELECT id, name, item FROM lottery ORDER BY id DESC LIMIT 1;');
foreach($lottery as $result) {
echo = '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!';
}
?>

i inne rzeczy ogarnąć lecz to samo się dzieje. Pomożecie? ;/
 

Attachments

display_errors w php.ini na 1 i jeszcze raz screen.
 
Last edited by a moderator:
Skoro dodajesz to w layoucie to daj tak:
PHP:
<?PHP
$lottery = $SQL->query('SELECT id, name, item FROM lottery ORDER BY id DESC LIMIT 1;');
foreach($lottery as $result) {
echo '<center>Every X hours we will choose one player who will win random item!<br/>
Last Winner: <a href="?subtopic=characters&name='.urlencode($resul t['name']).'">'.$result['name'].'</a> Item: <i>'.$result['item'].'</i> Congratulations!</center>';
}
?>
 
Qanti, opcje mam włączoną.
Koci, error 500.
No faktycznie, bym zapomniał że nie można tak połączyć z db ;p
Sprawdź to ;)
PHP:
<?PHP
mysql_connect("localhost","root","password") or die(mysql_error());
mysql_select_db("tfs_db") or die(mysql_error());
$query = mysql_query('SELECT id, name, item FROM lottery ORDER BY id DESC LIMIT 1;');
$key = mysql_fetch_array($query);
echo '<center>Every X hours we will choose one player who will win random item!<br/>
Last Winner: <a href="?subtopic=characters&name='.urlencode($key['name']).'">'.$key['name'].'</a> Item: <i>'.$key['item'].'</i> Congratulations!</center>';
?>
 
Last edited:
to samo omg ;/ ja pomysłów już nie mam... bo też sam kminie i dupa
 
Na pewno wpisujesz dobrą baze, hasło i użytkownika?

Wrzuć to do pliku php, zrób case w indexie i wywołaj plik php w lajołcie tam gdzie chcesz, wtedy będzie już przez index.php miał zincludowane sprawdzanie połączenie z bazą.
 
Może na początku powiedź czy używasz MySQL czy SQLite :>?
 
Back
Top