Hi,
Do a select query with a COUNT() in it....
if you dont understand that read the php manual for accessing the database
and lookup the mysql COUNT

-Ryan


On 2/16/2004 1:35:42 AM, PETCOL ([EMAIL PROTECTED]) wrote:
> PHP Newbie,
>
> I'm trying to find out if a username already appears in my database.
>
> I have two users in my table, one is colin so when I enter a username of
> colin I would normally under ColdFusion anyway just to something like:
> <cfif $query_qUsername.RecordCount GT 0>
> User already exists do something else, like throw the user back an error.
> </cfif>
>
> My Query works
> $query_qUsername = "SELECT * FROM users WHERE username = '$username'";
>
> I've
> tried a number of different things here and everything either comes
> back with nothing, or throws an error.
> $num_rows = mysql_num_rows($query_qUsername);
> echo $num_rows; // this comes back with nothing, I was expecting a
> numeric
> of 1
> exit;
>
> Regards
> Col
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to