Results 1 to 3 of 3

Thread: Adding Date Member Status Changed

  1. #1
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Adding Date Member Status Changed

    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...

    PHP Code:
    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";


  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    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.

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •