Your code is 'weird' to say the least :-)
The idea is there, but you are making some serious thinking-mistakes.
What are you trying to do?
- See if one particular person is in the database.
What do you know about that person?
- $NewUserBearID="Joe_Blow";
Is there a column in the table that contains users' newuserbearid info?
- Yes: BearID
So you want to know the info (*) from the table, where the bearid = $NewUserBearID...
- Yup, that's it.
then throw the select* from table; out, throw away the while loop, and just run
SELECT *
FROM table
WHERE BearID = $NewUserBearID;
and see if that gives any rows back (mysql_num_rows)
or, run this:
SELECT count(*) as cnt
FROM table
WHERE BearID = $NewUserBearID;
and fetch the first column of the first row. That will contain the number of times a record with BearID = $NewUserBearID was found.