PDA

View Full Version : Basic Syntax Problem


gorilla1
11-09-2002, 12:25 PM
Why does the following generate a parse error?

<?
if ($subpaytype1 != "") { ($subpaytype = 1)};

?>

G

Nightfire
11-09-2002, 01:09 PM
I guess it's the second brackets, use

<?
if ($subpaytype1 != "") {
$subpaytype = 1;
}

?>
Might also be that you used the semi-colon after the closing curly bracket

mordred
11-09-2002, 01:55 PM
Statements *must* be ended with a semi-colon; you missed one after asigning the value to the variable:


if ($subpaytype1 != "") { ($subpaytype = 1);};

gorilla1
11-09-2002, 01:55 PM
Thanks, Nightfire, yes, that does it!

G