select-php, do you want to query the SQL that the registered mailbox already exists, as follows?

Source: Internet
Author: User
Keywords Select MySQL PHP sql
Selectmysqlphpsql

The problem is solved.

Key code:
Query mailboxes for Duplicates

     $user_email = $_POST["user_email"];    $sql = "select count(*) from users where user_email='$user_email'";    $result = mysql_query($sql,$con);    $row = mysql_fetch_row($result);    if ( $row[0] > 0)     {           echo $row[0];        echo "
邮箱已注册过,请直接登陆或找回密码";} else { //----增加新的用户--begin

--------Issue update-------
Use the following code, and then register, enter the database already exists mailbox, will still register successfully.
This is not normal, ask where the problem appears?
After my positioning, as if the "Query mailbox is duplicated" code does not take effect, please help to see?

 //查询邮箱是否重复    $user_email = $_POST["user_email"];    $sql = "select count(*) from users where user_email='$user_email'";    if (mysql_query($sql,$con)=='1')     {echo "exist";}     else {        //----增加新的用户--begin
     
   
    
       
   
   ' Echo ' Registration is successful! ".'

"Echo" Pleased to meet you, ". $_post[" User_nickname "]. '
'; $url = '/login.php '; echo "Click here to Login";//Disconnect database connection mysql_close ($con);} }//----Add new user--end} else echo "
:( Failed, please modify ~ ";? >
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.