I'm wanting that when total $ arrive and go from 40 to div and li class="ta" go with display: block.
CSS:
.foo {
width: 50px;
height: 50px;
background-color: red;
float: left;
display:block;
}
.hide {
display: none;
}
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Meu Contator</title>
<link href="css/estilo.css" rel="stylesheet">
</head>
<body>
<?php
$servidor = 'localhost';
$banco = 'test';
$usuario = 'root';
$senha = '';
$link = @mysql_connect($servidor, $usuario, $senha);
$db = mysql_select_db($banco,$link);
$idUltimoItem = 0;
if(!$link)
{
echo "erro ao conectar ao banco de dados!";exit();
}
$sql = "SELECT * FROM tabela";
$query = mysql_query($sql);
$total = mysql_num_rows($query);
while($sql = mysql_fetch_array($query)){
}
echo "$total";
?> <br />
<div id="te" class="<?php echo $total >=40 ? 'foo' : 'hide'; ?>"></div>
<ul>
<li class="<?php echo $total >=3 ? 'foo' : 'hide'; ?>;"> <a href="#"><p>INGRESSO</p></a> </li>
</ul>
</body>
</html>