Jump to content

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


TGWSE_GY

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

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.