...

View Full Version : Update problem



mwm
04-25-2006, 06:06 PM
Using the code below I want to change the date to the current date if the post variable is equal to Prospect, but the date is changed to the current date no matter what is in the post variable. Is there something wrong with the code that I don't see?


if ($_POST['status'] = 'Prospect') {


$query = ("UPDATE cust Set status = '$status', regdate = curdate() WHERE id = '$id'");

$result = mysql_query($query) or die ("Could not Update");

}
else {

$query = ("UPDATE cust Set status = '$status' WHERE id = '$id'");

$result = mysql_query($query) or die ("Could not Update");
}

devinemke
04-25-2006, 07:30 PM
change this:


if ($_POST['status'] = 'Prospect') {

to this:


if ($_POST['status'] == 'Prospect') {

mwm
04-25-2006, 08:26 PM
Thanks I'll give it a try



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum