Forum Moderators: open
i have no idea as to how to go about this but have come up with something i think should work, but does not.
basically i have a script to insert a new user into a DB table with varying info, the usual i guess. what i am trying to do is to check to see if the username entered at registration is already in use.
$user_name_check = mysql_query("SELECT * FROM test
WHERE user_name=$UserName");
//check to see if the username already is in use
if (eregi($user_name_check, $UserName))
this is the code i thought may do it, however i get the following error
Warning: eregi() [function.eregi]: REG_EMPTY in C:\wamp\www\Sale\newuser.php on line 25
line 25 is the one with the eregi code on it.
am i barking completley up the wrong tree here or am i somewhere close.
many thanks for any help in advance,
even a pointer in the right direction along the lines of where i need to be looking would be nice.