Log in

View Full Version : Adding Date Member Status Changed



tomyknoker
04-10-2007, 07:12 AM
I have a php page where I can change the status of members in my database from 'Pending' to 'Approved', when I change a member to 'Approved' they receive an email... I want to also add a date when I change them, so once they are approved a date is added into a column in my database... If anyone can give me an idea that would be great! This is what I have so far...



mysql_query("UPDATE `tblmembers` SET `MemberApproved`='$status' WHERE `ID`='$id'");

//get Member Info
$userInfo = mysql_query("SELECT * FROM `tblmembers` WHERE `ID`='$id'");
$q = mysql_fetch_array($userInfo);

//get Email info
if ($status == "A") {
$emailInfo = mysql_query("SELECT * FROM `email` WHERE `email_id` = 'A'");

$stat = "Approved";
}

elseif ($status == "R") {
$emailInfo = mysql_query("SELECT * FROM `email` WHERE `email_id` = 'R'");

$stat = "Rejected";
}

codeexploiter
04-10-2007, 08:21 AM
You can execute another SQL query for inserting a data field in a table on the same script where you update the status from pending to approved, it can be done without much difficulty.

If you are looking for a script that does the above mentioned thing let me know that.

boogyman
04-10-2007, 01:00 PM
mysql_query("UPDATE `tblmembers` SET `MemberApproved`='$status' WHERE `ID`='$id'");
mysql_query("UPDATE 'tblmembers' SET 'DateApproved' = '$date' WHERE `ID`='$id'")

//get Member Info


where $date = the day that their status was approved.