Jump to content

Quick question on update queries. Please help!


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());

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.