I have the following code
$query = mysql_query("SELECT id, nome, situacao FROM clientes ORDER BY nome") or print mysql_error()
<select class="js-example-basic-single form-control" id="cliente" name="cliente">
<option value="Selecione o Cliente"> Selecione o Cliente</option>
<?php
while($dados = mysql_fetch_array($query)) { ?>
<option value="<?php echo $dados['id'] ?>">
<?php
if ($dados['situacao']==1) {
$dados['situacao']='Em dia';
} else {
$dados['situacao']='Devendo';
}
echo $dados['nome'] . ' -> '. $dados['situacao'];
?>
</option>
<?php } ?>
</select>
I needed that with the same verification as the field situacao
, I would show an alert showing that the client is