I'm trying to echo the value of the field form the database in the drop-down list retrieved from another table in the database, but I keep getting the Parse error: syntax error, unexpected T_IF
I know i am m missing something in the brackets to comma, but I can't seem to see it,
<?php
$result1 = mysql_query("SELECT `CompanyID`, `Name` FROM `company`") or trigger_error(mysql_error());
while($row1 = mysql_fetch_array($result1)) {
foreach($row1 AS $key1 => $value1) {
$row1[$key1] = stripslashes($value1);
}
echo "<option value=" . nl2br( $row1['CompanyID']) . " ". if($row['CompanyID'] == $Merchant) echo 'selected = "selected"'
. ">" . nl2br( $row1['Name']) . "</option>";
}
?>