In message <[EMAIL PROTECTED]>, Wade <[EMAIL PROTECTED]>
writes
>
>03282005 1803 GMT-6
>
>I have been working on something that I thought was pretty simple but 
>this just wont work.
>
>I want to see if a username is already in use. So, I compare the posted 
>one to one in the db and if one is returned. If a row is returned then 
>the username is in use. But its not working.
>
>Wade
>
>
>    $sql ="SELECT username FROM users WHERE username = ' " . 
>$_POST['user_name'] . " ' ";
>                $result = mysql_query($sql, $connection);
>           
>            if ( mysql_num_rows($result) == 1 ) {
>                $problemR = TRUE;
>                $errorR[] = 'Username is already in use. Please choose 
>again.';
>            }

Do you really have spaces here:
(I have put * to represent spaces which appear in your code, and
shouldn't be there)

>    $sql ="SELECT username FROM users WHERE username = '*" . 
>$_POST['user_name'] . "*'*";


-- 
Pete Clark

http://www.hotcosta.com
http://www.spanishholidaybookings.com




Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to