# ** The problem is solved. ** Key code: Check whether the email address is repeated & quot; $ user_email $ _ POST [& quot; user_email & quot;]; $ SQL & quot; selectcount (*) fromuserswhereuser_email & #39; $ user_email & #39; & quot; $ resultmysql_query ($ SQL, $ con); $ rowmysql_fetch_row ($ result ); if ($ row [0] & gt; selectmysqlphpsql
The problem is solved.
Key code:
// Check whether the email address is repeated
$ 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"
The email address has already been registered. Please log in or retrieve the password ";} else {// ---- add a new user -- begin
-------- Problem update -------
Use the following code. when registering, enter an existing email address of the database, and the registration will still be successful.
This is not normal. where is the problem?
After my positioning, it seems that the code "check whether the email address is repeated" has not taken effect. could you please take a look?
// Check whether the email address is repeated $ user_email =$ _ POST ["user_email"]; $ SQL = "select count (*) from users where user_email = '$ user_email '"; if (mysql_query ($ SQL, $ con) = '1') {echo "exist";} else {// ---- add a new user -- begin
'; Echo "registration successful! ".'
'; Echo "Nice to meet you,". $ _ POST ["user_nickname"].'
'; $ Url ='/login. php'; echo "Click here to log on"; // disconnect the database mysql_close ($ con) ;}// ---- add a new user -- end} else echo"
:( Failed, please modify ~ ";?>