Searching MySQL database
Posted 08 October 2005 - 01:31 PM
Of course, I dont want two users to pick the same username, so what I need to know is how to search the MySQL table to find out if a specific user name has already been picked?
For example, a user enters desired username: Bob
So I need to search if there already is a user registered with "Bob"
How do I do this?
Posted 10 October 2005 - 12:52 PM
$query = "SELECT * FROM users_table WHERE username='$username'";
$res = mysql_query($query, $dbh);
$rows = mysql_num_rows($res);
if ($rows > 0)
// continue to add the user
MySQL Auto Backup
Professional MySQL Backup Automation Software on Windows
Posted 13 October 2005 - 08:20 PM
or [php] * 1000... PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users