Jump to content

[SOLVED] Question on UPDATE statement for MySQL


webref.eu

Recommended Posts

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.