if(is_numeric($_REQUEST[credit])) && if($_REQUEST[credit] == 1) && if($result[cash]<=$free_credit_trigger) $can_reset = true; PHP: Parse error: syntax error, unexpected T_BOOLEAN_AND in [path] on line X so I tried to wrap the Ifs in another bracket if((is_numeric($_REQUEST[credit])) && if($_REQUEST[credit] == 1) && if($result[cash]<=$free_credit_trigger)) $can_reset = true; PHP: Parse error: syntax error, unexpected T_IF in [path] on line X I tried adding { } as well, which I know is optional in some simple circumstances. I am assuming the first example is the closest im getting. Ive been trying for an hour. Please help
*FACEPALM* if((is_numeric($_REQUEST[credit])) && ($_REQUEST[credit] == 1) && ($result[cash]<=$free_credit_trigger)) $can_reset = true; PHP: I feel like an idiot. thanks anyway. hahaha
You dont nest IF's within the IF itself. I also don't think you even need to compound your statements in that IF statement at all. This is the correct code for what you have written if(is_numeric($_REQUEST[]) && $_REQUEST['credit'] == 1 && $result['cash'] <= $free_credit_trigger) { $can_reset = true; } PHP: Brackets like you've done is for compounding statements, something like this: if(($var1 == "something" || $var1 == "somethingElse") && ($var2 >= '1' && $var2 <= '10)) { } PHP: So you can have multiple, compounded conditions. I don't see the need to compound the statements like you have there.
Also $result[cash] PHP: Is semantically incorrect. $result['cash'] PHP: Is correct, while PHP will allow you to ommit the '' from the array you should include it else you can encounter problems later.