Created
December 3, 2012 23:37
-
-
Save lfzawacki/4199092 to your computer and use it in GitHub Desktop.
PHP STUFF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sql0 = mysql_query("SELECT DISTINCT nomecliente FROM andamento ORDER BY nomecliente") or die ("Erro: ".mysql_error()); | |
$list_options = ""; | |
while ($aux0 = mysql_fetch_array($sql0)) { | |
$nome = $aux0["nomecliente"]; | |
/* Cria uma string com as options de todos clientes, coloca um depois do outro */ | |
$list_options .= "<option value='$nome'>$nome</option>\n"; | |
/* Fica tipo | |
<option value='lucas'>lucas</option> | |
<option value='rael'>rael</option> | |
... | |
*/ | |
?> | |
<select name="nomecliente" id="nomecliente"> | |
<option selected="selected" value="<? echo $nomecliente; ?>"><? echo $nomecliente; ?></option> | |
<?php | |
/* aqui para cada cliente imprime a lista inteira, que foi feita ANTES*/ | |
echo($list_options) | |
?> | |
</select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment