Parse error: syntax error, unexpected ';' in C: \ xampp \ htdocs \ edit-advert.php on line 68

0

My line 68 looks like this.

<option value="0"<?php echo ($info['estado']=='0')?'selected="selected"';'';?>>Não Pago</option>
    
asked by anonymous 20.10.2017 / 07:03

2 answers

1

I think this is what you want:

<?php if ($info['estado']=='0') {?> 
    <option value="0" selected="selected">Não Pago</option>
<?php } else { ?>
    <option value="0">Não Pago</option>
<?php } ?>
    
20.10.2017 / 07:16
1

As I can not test at this time because it's on my cell phone, I'll leave two options below:

Option 1:

<option value="0" <?php echo ($info['estado']=='0')?' selected ="selected"' : ''; ?>>Não Pago</option>

Option 2:

<?php
if($info['estado']=='0') $select = ' selected="selected"'; else $select = "";
?>
<option value="0"<?php echo $select; ?>>Não Pago</option>

Good luck!

    
20.10.2017 / 07:16