1
I’m trying to get the item selected which has the id
equal to that of the $_REQUEST
$combo .= "<option value='".$row_area->area_id."' ".if($id == $row_area->area_id) { echo "selected"; } .">".$row_area->are_descricao."</option>";
But it’s just that you’re displaying that mistake:
Parse error: syntax error, unexpected 'if' (T_IF)
, the complete code is 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>";
}