czs Posted February 21, 2008 Share Posted February 21, 2008 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()); Quote Link to comment https://forums.phpfreaks.com/topic/92363-quick-question-on-update-queries-please-help/ Share on other sites More sharing options...
sasa Posted February 22, 2008 Share Posted February 22, 2008 yes just add another query Quote Link to comment https://forums.phpfreaks.com/topic/92363-quick-question-on-update-queries-please-help/#findComment-473247 Share on other sites More sharing options...
drisate Posted February 22, 2008 Share Posted February 22, 2008 No do it in one query like this: [...]Match1=%s, ConMatch1='UPDATE IT TO THIS'[...] Quote Link to comment https://forums.phpfreaks.com/topic/92363-quick-question-on-update-queries-please-help/#findComment-473248 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.