TGWSE_GY Posted April 15, 2009 Share Posted April 15, 2009 Hi Guys, I have a db named login_ums and in that table I am trying to go into the login table which has columns CustID Usr Pass MemStat and Email. What I am trying to do is access a specific record and delete the contents in MemStat which is NoConf that is set when the user signs up and replace it with Conf after the user verifies their email address. The code follows: <?PHP $varUsr = $_POST['formUsr']; $varEmail = $_POST['formEmail']; $varConfNum = $_POST['formConfNum']; $varConfirmed = "Conf"; include('config.php'); $con = mysql_connect($Host, $Login, $Pass); mysql_select_db(login_ums, $con); $testAcct = mysql_query("SELECT * FROM `confirm` WHERE ConfNum = '$varConfNum'"); if (mysql_num_rows($testAcct)) { mysql_query("DELETE MemStat FROM login WHERE Usr = '$varUsr'"); mysql_query("INSERT INTO `login` WHERE Usr = '$varUsr' ( CustID,Usr,Pass,MemStat,Email ) VALUES ('' , '' , '', '$varConfirmed', ''"); mysql_close($con); header('Location: http://www.thegayestcommunityever.com/dev/index.php?section=confirmsuccess'); } else { echo "The information you entered is invalid, please press back and re-enter your information"; } ?> Any help is greatly appreciated. Thanks Guys! Quote Link to comment https://forums.phpfreaks.com/topic/154148-solved-trying-to-delete-data-from-a-record-and-insert-new/ Share on other sites More sharing options...
fenway Posted April 15, 2009 Share Posted April 15, 2009 Help with what? Quote Link to comment https://forums.phpfreaks.com/topic/154148-solved-trying-to-delete-data-from-a-record-and-insert-new/#findComment-810603 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.