Jump to content

Quick question on update queries. Please help!


czs

Recommended Posts

Dreamweaver created this php for me that works great.  The update command updates the users table where the email is = to a hidden field that I have in place.  The user first clicks a radio button and then clicks "submit" and then whatever was in that particular radios button value gets submitted to the table, tblprofile, and added to the record based on the above email primary key.

 

I want it so that when the user clicks update, another update will be executed simultanesouly.  I want it to update a different field, ConMatch1, in the same table, tblProfile.  This new update will get matched with a different primary key/email that will be based off the current session variable, MM_Username.  The value that I want to be inserted to the different field is found in a recordset that is already retrieved with this page, $row_rsUser['Match1'].

 

Can I just add some extra lines to the code that i already there to get this to work?

Thank you very much!

 

Some Notes

M1email is the hidden field that makes up the primary key for this update.  M1Accept is the name for the radio button group that submits text.

 

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  $updateSQL = sprintf("UPDATE tblprofile SET Match1=%s WHERE email=%s",
                       GetSQLValueString($_POST['M1Accept'], "text"),
                       GetSQLValueString($_POST['M1email'], "text"));

  mysql_select_db($database_connPFD, $connPFD);
  $Result1 = mysql_query($updateSQL, $connPFD) or die(mysql_error());

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.