php checking

Status
Not open for further replies.

Macemore

Circumcised pineapples
Aug 26, 2011
1,681
819
so I've got it to get the player's name from the game already ($player) all I need to know is how to cross check it with the database, like to make sure that the $player's name is in the database, and if it's not then return some way of me letting them know that :S.
I'm not very good at php D:
 

XenPHP

New Member
Apr 13, 2012
16
1
I'll do it for you. I'll edit this post, and alert you in the shoutbox when I am complete. After all, I have PHP in my name :D

PHP:
//add database connection first
$q = mysql_query("SELECT FROM players WHERE name = '".$player."'");
 
if(mysql_num_rows($q) < 1) {
    die("The name <b>".$player."</b> does not exist in the database.");
}
 

Macemore

Circumcised pineapples
Aug 26, 2011
1,681
819
I'll do it for you. I'll edit this post, and alert you in the shoutbox when I am complete. After all, I have PHP in my name :D
thanks very much, I'm making a whitelisting plugin with bukkit :D.
and I'm banned from the chatbox, idk why.
 
Status
Not open for further replies.

Users who are viewing this thread

Top