ChrisMartino Posted April 13, 2010 Share Posted April 13, 2010 Ok so i have the code here were if the validation code in the database match's the one in the url it changes a number in the mysql but it doesn't? This is the code were i change the number in the MySQL: $URL = $_GET['account']; $URLVALIDATE = $_GET['validate']; if($URL == "confirm") { $Stats = 1; $UpdateUser = mysql_query("UPDATE `chrismar_xhost`.`Clients` SET `Status` = \'1\' WHERE `Clients`.`Validation` = '".$URLVALIDATE."'"); if($UpdateUser) { echo"<p>You're email address has been validated.</p>"; } else { echo"<p>There was a problem with the validation code.</p>"; } } It just echo's there was a problem with the validation code? can anyone help?!? :[ Link to comment https://forums.phpfreaks.com/topic/198331-not-updating-mysql/ Share on other sites More sharing options...
JAY6390 Posted April 13, 2010 Share Posted April 13, 2010 Have you connected to the database? Run echo mysql_error(); after the query line, and see what that spits out Link to comment https://forums.phpfreaks.com/topic/198331-not-updating-mysql/#findComment-1040640 Share on other sites More sharing options...
ChrisMartino Posted April 13, 2010 Author Share Posted April 13, 2010 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 '\'1\' WHERE `Clients`.`Validation` = '3071'' at line 1 :/ Link to comment https://forums.phpfreaks.com/topic/198331-not-updating-mysql/#findComment-1040642 Share on other sites More sharing options...
JAY6390 Posted April 13, 2010 Share Posted April 13, 2010 Try this $UpdateUser = mysql_query("UPDATE `chrismar_xhost`.`Clients` SET `Status` = '1' WHERE `Clients`.`Validation` = '".$URLVALIDATE."'"); Link to comment https://forums.phpfreaks.com/topic/198331-not-updating-mysql/#findComment-1040643 Share on other sites More sharing options...
ChrisMartino Posted April 13, 2010 Author Share Posted April 13, 2010 Try this $UpdateUser = mysql_query("UPDATE `chrismar_xhost`.`Clients` SET `Status` = '1' WHERE `Clients`.`Validation` = '".$URLVALIDATE."'"); Thanks worked brilliantly!, Many thanks!. Link to comment https://forums.phpfreaks.com/topic/198331-not-updating-mysql/#findComment-1040646 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.