mysql - PHP check database for user ID -


I am sending data with jquery ajax to a php doctor first check on user information ( $ check_user_exists < / Strong>) is to see if there is an account under $ email ? If I tried to write the function before the statement, but that too is not working.

I am getting the following error:

Parse error: Syntax error, C: \ xampp \ htdocs \ workflow \ ajax \ register.php on line 8

Unexpected 'Return' (Thanks before time)! Here's the code:

  if (isset ($ _ POST ['email']) and isset ($ _ POST ['firstname']) and amp; and isset ($ _Post [last name ']) and release ($ _ POST [' role ']) and dispatch ($ _ POST [' pw '])) {$ email = strtolower ($ _ POST [' email ' ]); $ First name = $ _POST ['first name']; $ Lastname = $ _POST ['last name']; $ Pw = crypt ($ _ POST ['pw'], MD5 ($ email)); $ Role = $ _POST ['role']; $ Check_user_exists = Return (mysql_result (mysql_query ("Select 'user_id` from user' where user_ id = '$ email.'"), 0) == 1)? right wrong; If ($ check_user_exists === true) {echo 'our records show that an account already exists under this email.'; }  

like it:

  $ Email = mysql_real_escape_string (stroller ($ _ POST ['email'])); $ First name = mysql_real_escape_string ($ _ POST ['first name']); $ Lastname = mysql_real_escape_string ($ _ POST ['last name']); $ Pw = crypt ($ _ POST ['pw'], MD5 ($ email)); $ Role = mysql_real_escape_string ($ _ POST ['roles']); $ Result = mysql_query ("SELECT COUNT (*) as user 'where user_id =' $ email ') or die (mysql_error ()); $ Line = mysql_fetch_assoc ($ result); $ Check_user_exists = $ line ['count']; If ($ check_user_exists & gt; 0) {echo 'our record shows that an account already exists under this email.'; } Other {mysql_query ("username, first name, last name, pw, roll) value ('$ email', '$ first name', '$ last name', '$ pw', '$ role')") Or die (mysql_error ()); Echo 'user successfully added'. '; }  

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -