Your code contains multiple errors:
PHP Code:
mysql_connect(localhost,$username,$password);
should be:
PHP Code:
mysql_connect('localhost',$username,$password);
then in this block:
PHP Code:
if($resultaff="Pending"){
$affstatus="Pending";
} elseif($resultaff="Approved"){
$affstatus="Approved";
} elseif($resultaff="Declined"){
$affstatus="Declined";
} else {
//do nothing
}
you are using the = operator (which is assignment), when you should be using == (which is for an equality test).
i.e.:
PHP Code:
if($resultaff == "Pending"){
$affstatus="Pending";
} elseif($resultaff == "Approved"){
$affstatus="Approved";
} elseif($resultaff == "Declined"){
$affstatus="Declined";
} else {
//do nothing
}
Which is kind of a moot point because your if-else clause doesn't currently do anything useful - you could simply replace the whole thing with:
PHP Code:
$affstatus = $resultaff;
Also you are running mysql_query() twice for no reason.
Bookmarks