Portanto o correto seria:
echo "<ol>"; while($linhas = mysql_fetch_array($selecionar_dados)){ echo "<li> ".$linhas['nome']."</li><br />"; } echo "</ol>";
Faça o teste ai.
Abraço!
There have been 6 items by xThiAg0 (Search limited from 28/05/2023)
Posted by xThiAg0 on 19/12/2007, 22:20 in PHP
echo "<ol>"; while($linhas = mysql_fetch_array($selecionar_dados)){ echo "<li> ".$linhas['nome']."</li><br />"; } echo "</ol>";
Posted by xThiAg0 on 05/09/2008, 01:16 in PHP
Não, são variáveis. Na hora de publicar aqui esqueci de colocar o $.Como está seu array?
E NOTICIAS e INSCRICOES ali sao Constantes?
Da seguinte maneira (resultado do print_r($nivel)):ja deu um print_r($nivel) para se certificar dos valores?
[vem antes..] <input type="checkbox" name="nivel[]" id="nivel0" value="noticias "/> <label for="nivel0">Gerenciar notícias </label><br /> <input type="checkbox" name="nivel[]" id="nivel1" value=" palestras "/> <label for="nivel1"> Gerenciar palestras </label><br /> <input type="checkbox" name="nivel[]" id="nivel2" value=" incricoes "/> <label for="nivel2"> Gerenciar inscrições </label><br /> <input type="checkbox" name="nivel[]" id="nivel3" value=" administradores"/> <label for="nivel3"> Gerenciar administradores </label><br /> [vem depois...]
$nivel = $_POST["nivel"]; foreach($nivel as $valor) { echo $valor, "<br>\r\n"; //Exibe isto normalmente if ($valor == "noticias"){ echo "Tem notícias"; //Não exibe $noticias += 1;} //Não soma if ($valor == "palestras"){ echo "Tem palestras"; //Não exibe $palestras += 1;} //Não soma if ($valor == "inscricoes"){ echo "Tem inscricoes"; //Não exibe $inscricoes += 1;} //Não soma if ($valor == "administradores"){ echo "Tem administradores"; //Não exibe $administradores += 1;} //Não soma } echo "$noticias, $palestras, $inscricoes e $administradores";Exibe:
noticias
palestras
incricoes
administradores
, , e
Posted by xThiAg0 on 04/09/2008, 18:44 in PHP
foreach($nivel as $valor) { echo $valor, "<br>\r\n"; \\Exibe isto normalmente if ($valor == "noticias")){ echo "Tem notícias"; \\Não exibe noticias += 1;} \\Não soma if ($valor == "inscricoes")){ echo "Tem inscricoes"; \\Não exibe inscricoes += 1;} \\Não soma }
if(current($nivel)=="noticias")Mas também não funcionou.
Posted by xThiAg0 on 19/12/2007, 17:10 in PHP
Posted by xThiAg0 on 19/12/2007, 19:51 in PHP
Community Forum Software by IP.Board
Licensed to: Webmasters Online