I'm trying to leave the selected item which has id
equal to $_REQUEST
$combo .= "<option value='".$row_area->area_id."' ".if($id == $row_area->area_id) { echo "selected"; } .">".$row_area->are_descricao."</option>";
But it's only showing this error:
Parse error: syntax error, unexpected 'if' (T_IF)
, the complete code looks like this:
for($j = 0; $j < $table_area->RowCount(); $j++) {
$row_area = $table_area->getRow($j);
$combo .= "<option value='".$row_area->area_id."' ".if($id == $row_area->area_id) { echo "selected"; } .">".$row_area->are_descricao."</option>";
}