Hola compañeros tengo un problema ya que en este codigo de una web que estoy haciendo se deberia mostrar todos los registros de una base de datos cumpliendo las condiciones de area=1 y categoria=0. Gracias espero que puedan ayudarme.
Saludos
Código PHP:
<html>
<head><title>Escribir y dibujar - Material - Pedidos - PAI</title></head>
<BODY style="BACKGROUND-COLOR: #84f2ff; DISPLAY: block"><center>
<DIV style="padding:0; border-style:ridge; border-width:3; WIDTH: 583; height:126; background-color:#FFFFFF">
<H1><font face="Arial Black" size="7">
<img border="0" src="logo1.jpg" align="left" hspace="0" width="126" height="126">P.A.I.</font></H1>
<p><font face="Arial Black" size="2">Programa de Administración de Inventarios
</font></DIV>
</center>
<?php
mysql_connect("localhost", "digiocio_com", "emaibo");
mysql_select_db("digiocio_com_1");
include("login.php");
if($loginCorrecto)
{
include("status.php");
include("status1.php");
echo "<center><p><br><font size=2 color=black>Hola ".$nombreUsuarioL.", tienes ".$pedidosUsuarioL." pedidos pendientes y ".$aceptadosUsuarioL." aceptados.</p>";
echo "<table border=0 width='600' style='border-collapse: collapse' bordercolor='#111111' cellpadding='0' cellspacing='0'><tr><td>";
echo "<a href='cuenta.php'><img src='menu.jpg' border='0' title='Menu principal'></img></a><br>";
echo "<a href='datos.php'><img src='datos.jpg' border='0' title='Consulte/edite sus datos personales'></img></a><br>";
echo "<a href='pedidos.php'><img src='pedidos.jpg' border='0' title='Realize nuevos pedidos'></img></a><br>";
echo "<a href='intendencia.php'><img src='intendencia.jpg' border='0' title='Acampada, luces a gas...'></img></a><br>";
echo "<a href='material.php'><img src='material.jpg' border='0' title='Pinturas, reglas, celo...'></img></a><br>";
echo "<a href='carro.php'><img src='carro.jpg' border='0' title='Carro de compra'></img></a><br>";
echo "<a href='gestion.php'><img src='gestion.jpg' border='0' title='Gestione sus pedidos'></img></a><br>";
echo "</td><td>";
include("pai.php");
echo "</font></center><p>";
include("pai.php");
echo "<b><a href='cuenta.php'>PAI</a> > <a href='pedidos.php'>PEDIDOS</a> > <a href='material.php'>MATERIAL</a> > Escribir y Dibujar</b><br><center><h3>Escribir y dibujar</center><p>";
$result5 = mysql_query("SELECT * FROM productos WHERE area='1' AND categoria='0'");
if($row = mysql_fetch_array($result5))
{
if($row["cantidadart"] ==0)
{
echo "<center><table border=1 bordercolorlight='#C0C0C0' bordercolordark='#808080' bordercolor='#111111' cellpadding='0' cellspacing='0'><tr><td><table border=0><tr><td> ".$row["nombreart"]." </td>";
echo "<td> No disponible. </td></tr></table></td></tr><tr><td><center> ".$row["descripcionart"]." </center></td></tr>";
echo "</table>";
}
else
{
echo "<center><table border=1 bordercolorlight='#C0C0C0' bordercolordark='#808080' bordercolor='#111111' cellpadding='0' cellspacing='0'><tr><td><table border=0><tr><td> ".$row["nombreart"]." </td>";
$a = date("d");
$b = date("m");
$c = date("Y");
$numpedidoUsuarioL = date("dmY");
echo "<td> ".$row["cantidadart"]." unidades. </td><td><form action='http://pai.digiocio.com/pedir.php' method='post'>Reservar<input type='hidden' name='idart' value='".$row["idart"]."' ><input type='hidden' name='idpedido' value='".$numpedidoUsuarioL."' ><input type='hidden' name='datedia' value='".$a."' ><input type='hidden' name='datemes' value='".$b."' ><input type='hidden' name='dateaño' value='".$c."' ><input type='hidden' name='nick' value='".$nickUsuarioL."' ><input type='hidden' name='area' value='".$row["area"]."' ><input type='hidden' name='categoria' value='".$row["categoria"]."' ><input type='hidden' name='nombreart' value='".$row["nombreart"]."' ><input type='text' name='cantidad' size='3' maxlength='3' value='".$row["cantidadart"]."' ><input type='hidden' name='estado' value='' ><input type='submit' name='submit' value='OK'></form></td></tr></table></td></tr><tr><td><p align='center'>".$row["descripcionart"]."</p></td></tr></center>";
echo "</table>";
}
}
else
{
echo "<tr><td><p align='center'> NO HAY ARTICULOS DISPONIBLES </p></td></tr>";
}
mysql_free_result($result5);
echo "</td></tr></table>";
echo "<p> </p><p align='left'><font face='Bookman Old Style' size='1' color='#008080'>By </font><font face='Bookman Old Style' size='1' color='#C0C0C0'><a href='http://corporation.digiocio.com/'><font color='#008080'>Digiocio Corporation</font></a></font></p>";
}
else
{
echo "El sistema no lo ha identificado, solo los usuarios registrados tienen acceso a esta area";
}
?>
</body></html>