Galera ainda estou aprendendo e estou com um probleminha, preciso fazer uma consulta no BD e listar todos os cadastrados, isto está funcionando bem, mas também gostaria de exbir o status deste cadastro (ativo ou não). Para ter esta referencia em criei no BD um campo "status" sendo que 1=ativo e 0=inativo, porém eu não consigo fazer ele me mostrar isso no codigo abaixo, porque estou tendo que fazer o IF dentro echo :wacko: alguém pode me dar uma luz? <?php
include"config.php";
$y = mysql_query("SELECT * FROM cadastro WHERE id");
while($x = mysql_fetch_array($y)){
echo'<table width="600" border="0" cellspacing="1" bgcolor="#339900">
<tr>
<td width="100%" height="51" valign="top" bgcolor="#FFFFFF">
<table width="100%" height="31" border="0" cellspacing="0">
<tr>
<td width="20"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Nome:</font></strong></td>
<td width="20"><font color="#003399" size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href=detalhes.php?id='.$x['id'].'>'.$x['nome'].'</a>
</td>
<td width="20"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">OS SM:</font></strong></td>
<td width="20"><font color="#003399" size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href=detalhes.php?id='.$x['id'].'>'.$x['os_sm'].'</a>
</td>
<td width="20"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">OS Forn.:</font></strong></td>
<td width="20"><font color="#003399" size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href=detalhes.php?id='.$x['id'].'>'.$x['os_fornecedor'].'</a>
</td>
<td width="5" align=right>
<font color=red> <a href=editar.php?id='.$x['id'].'>Editar</a></div></font></td>
<td width="5" align=right>
<font color=red>
Status:
<?php
$xx = '.$x['status'].';
if ($xx == "0") {
$stat = "Retornada";
}
else {
$stat = "Em manut.";
};
?>
</div></font></td>
</tr>
</table></td>
</tr>
</table>
<br><br>
';
}
?></p>