i have a table with "userid'!
how can i check if the user id exist or not?
thanks i advance
peleg
How do i check if a user already exist i nmy table
Moderator: General Moderators
i assuming that your talking about a mysql table...
check this out, should help you
http://www.mysql.com/doc/en/Retrieving_data.html
what you would be looking to do would be something like:
you get the general idea... hopefully thats enough to get you going and learning... but no too much so as you dont learn at all
check this out, should help you
http://www.mysql.com/doc/en/Retrieving_data.html
what you would be looking to do would be something like:
Code: Select all
$result = mysql_query("select idnumber from table1 where userid = $user");
if ($row = mysql _fetch_row($result)
echo "username already used by {$rowї'idnumber']}";
else
{//stuff
}