Emperio Posted March 19, 2010 Share Posted March 19, 2010 Hi all, I need some help with some PHP code. I want to know how i can check if user exists or not. for example in my mysql there is a user named tester1 someone want to attack a player so he types his name like tester3, I want PHP to check if this row exists or not. So when he types tester3 instead of tester1 there must come a message like "wrong username"; Link to comment https://forums.phpfreaks.com/topic/195854-2-questions/ Share on other sites More sharing options...
Catfish Posted March 20, 2010 Share Posted March 20, 2010 usually in multiuser systems, there would be a database table that holds user information. if someone wants to interact with another user, they input the username then your code should check if that username exists in the user information table in the database. if it exists, continue the action else output error (unknown username), handle the error (ask user to input username again) or abort with error. Link to comment https://forums.phpfreaks.com/topic/195854-2-questions/#findComment-1028852 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.