Jump to content

[SOLVED] Trying to delete data from a record and insert new


Recommended Posts

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! ;D

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.