phpretard Posted April 28, 2009 Share Posted April 28, 2009 Why do I Get: It's a simple update... You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Key='7cf93e806305aefc7495c8dca49f090f'' at line 1 $ReceiverNumber="123456"; $key="md5('2 emails')"; mysql_query("update preferred_list_new set ReceiverNumber='$ReceiverNumber', Status='Active' where Key='$key' "); I can't even count how many times I've updated a database. Quote Link to comment Share on other sites More sharing options...
trq Posted April 28, 2009 Share Posted April 28, 2009 Put your query in a variable and echo it so you can actually see what it looks like. Quote Link to comment Share on other sites More sharing options...
phpretard Posted April 28, 2009 Author Share Posted April 28, 2009 Like this? $CheckRegistrationStatus = mysql_query("select Email, MemberID from users where Email = '".mysql_escape_string($receiver)."'"); if (mysql_num_rows($CheckRegistrationStatus) == 1) { while($row=mysql_fetch_array($CheckRegistrationStatus)){ $ReceiverNumber=$row['MemberID']; } $update_preferred=mysql_unbuffered_query("update preferred_list_new set ReceiverNumber='$ReceiverNumber', Status='Active' where Key='$key' "); echo $update_preferred; //<<<<<<<< exit; //<<<<<<<< redirect("index.php?ma=user_acceptinvitation"); } else { if ($UserType == "Lender") { redirect("index.php?ma=register&t=7f5b0c220104c053887a2950c204bcb3"); } elseif ($UserType == "Appraiser"){ redirect("index.php?ma=register&t=43e561fc584ef009b5ee5bbd2e6eb162"); } } Page goes blank Quote Link to comment Share on other sites More sharing options...
trq Posted April 28, 2009 Share Posted April 28, 2009 No, I said put your query in a variable then echo it, your code does nothing of the sort. $sql = "SELECT foo FROM bar"; echo $sql; Quote Link to comment Share on other sites More sharing options...
phpretard Posted April 28, 2009 Author Share Posted April 28, 2009 Thank a million! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.