webref.eu Posted February 22, 2009 Share Posted February 22, 2009 Hi All I currently have the following query statement: $query = "UPDATE Users SET EmailConfirmed='1' WHERE AuthCode='$AuthCode'"; Which I need for a particular user to get their e-mail confirmed when they visit a url such as: http://www.mydomain.com/user-authentication.php?AuthCode=f4b702cd7a8f06f53708fbcdbda1af48&ProductId=1 Now, the particular $AuthCode in question will relate to a particular Username in the database, and I need to lift this Username from the database to use in my script. Is there a clever way to get the UPDATE done and somehow lift the Username value in a single SQL query, or am I going to have to do a second SELECT statement? Many thanks Link to comment https://forums.phpfreaks.com/topic/146375-solved-question-on-update-statement-for-mysql/ Share on other sites More sharing options...
Mchl Posted February 22, 2009 Share Posted February 22, 2009 None that I know of. Queries that modify data and queries that fetch data should be separated. Link to comment https://forums.phpfreaks.com/topic/146375-solved-question-on-update-statement-for-mysql/#findComment-768511 Share on other sites More sharing options...
webref.eu Posted February 22, 2009 Author Share Posted February 22, 2009 Ok, thanks, that makes sense. Rgds Link to comment https://forums.phpfreaks.com/topic/146375-solved-question-on-update-statement-for-mysql/#findComment-768523 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.