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. Link to comment https://forums.phpfreaks.com/topic/155958-solved-simple-query-problem/ 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. Link to comment https://forums.phpfreaks.com/topic/155958-solved-simple-query-problem/#findComment-820962 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 Link to comment https://forums.phpfreaks.com/topic/155958-solved-simple-query-problem/#findComment-820965 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; Link to comment https://forums.phpfreaks.com/topic/155958-solved-simple-query-problem/#findComment-820968 Share on other sites More sharing options...
phpretard Posted April 28, 2009 Author Share Posted April 28, 2009 Thank a million! Link to comment https://forums.phpfreaks.com/topic/155958-solved-simple-query-problem/#findComment-820969 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.