Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[SQL Question] Banned accounts

Junior Spellweaver
Joined
Jan 16, 2007
Messages
133
Reaction score
0
I'm trying to make this show who's banned but instead of showing their char names it tells me how many exp:4 lol... >.> forgive me for being a noob in SQL :/

$hostname = "localhost";
$username = "root";
$password = "pw";
$db = "rose131";

$sql = mysql_connect($hostname,$username,$password);
mysql_select_db($db);

$query = mysql_query("SELECT * FROM accounts WHERE accesslevel = '0'");
$result = mysql_num_rows($query);

echo " $result";

mysql_free_result($query);

Thanks in advice.
 
Custom Title Activated
Member
Joined
Aug 8, 2004
Messages
3,892
Reaction score
20
use mysql_fetch_assoc instead of mysql_num_rows.

mysql_num_rows, does, indeed, list the number of rows in the last set.
 
Junior Spellweaver
Joined
Jan 16, 2007
Messages
133
Reaction score
0
It kinda worked because i have like 10 people banned from my server and it only showed 1 person lol, is that suppost to happen? o_O
 
All is well...
Member
Joined
Feb 22, 2006
Messages
1,520
Reaction score
0
Did just grab the last inserted value? ^_^ *hint* *hint*
ORDER BY accesslevel =p
 
Divine Celestial
Member
Joined
Jul 7, 2004
Messages
853
Reaction score
5
sage

Read PHP Manual and MySQL Reference Manual for more information on using MySQL functions in PHP.
 
Back
Top