• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Sql zapytanko :)

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Reaction score
72
Location
Poland
Jak dorobic do tego

$SQL->query('SELECT name,level,experience FROM players ORDER BY experience DESC LIMIT 5')->fetchAll();

zeby wykluczalo nam sample?
 
Sample zazwyczaj maja ID mniejsze od 5(?), to dodaj WHERE `id` > 4, heh i oki.

albo WHERE `name` NOT LIKE '%sample' <- nie wiem czy to case-sensitive czy nie, sorks :(
 
PHP:
SELECT `name`, `level`, `experience`
FROM `players`
WHERE `name` NOT LIKE '%sample'
ORDER BY `experience` DESC
LIMIT 5
 
Sample zazwyczaj maja ID mniejsze od 5(?), to dodaj WHERE `id` > 4, heh i oki.

albo WHERE `name` NOT LIKE '%sample' <- nie wiem czy to case-sensitive czy nie, sorks :(

not like nie sprawdza sie tutaj wywala blad NOT LIKE 'tu'
 
not like nie sprawdza sie tutaj wywala blad NOT LIKE 'tu'

o.O

mi dziala ;\

a zrobiles z ' -> \' ? heh

PHP:
$SQL->query('SELECT `name`, `level`, `experience` FROM `players` WHERE `name` NOT LIKE \'%sample\' ORDER BY `experience` DESC LIMIT 5');
 
PHP:
SELECT `name`, `level`, `experience`
FROM `players`
WHERE `name` NOT LIKE "%sample"
ORDER BY `experience` DESC
LIMIT 5
Zobacz teraz. Zamiast ' trzeba "
Mi działa.
 
PHP:
SELECT `name`, `level`, `experience`
FROM `players`
WHERE `name` NOT LIKE "%sample"
ORDER BY `experience` DESC
LIMIT 5
Zobacz teraz. Zamiast ' trzeba "
Mi działa.

Aleh jest plusem :)
 
Back
Top