php - Help on how to continue with code that verifies a registered user and updates mySQL -


When a user registers, the script sends an email to verify its account. When clicking on the link, the script gets the token

  $ token = mysql_real_escape_string ($ _GET ["token"]);   

and what I have to do

  if ($ token! = '') {Mysql_query ("updated member SET verified = '' WHERE verified = ' $ Token '"); } ($ Token! = '') {$ Result = mysql_query} ("updated members have been verified by SET"}   

or

  = '' WHERE verified = '$ token' "); if ($ result) {} else {}}   

What is my purpose that success on user Or the unsuccessful message is to be resonated when it succeeds, then verified will be empty.

What is the proper way to do it with the examples above?

Should I check if the tokens should be updated in DB

Thank you.

If your presence is present, But does not exist in your account, it updates your records, which does not exist or does not match. You should run something like this:

  if ($ token ! = '') {$ Result = mysql_query ("SELECT COUNT (*) members where verified = '$ token'"); while ($ line = mysql_fetch_row ($ result)) {$ records = $ row [0]; } If ($ record == 0) {echo 'no results'; } Elseif ($ record == 1) {echo 'matching you'; Then update the record. }}   

edit

while the loop was changed back, 0 rows did not think about counting back

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -