Ver Mensaje Individual
  #3 (permalink)  
Antiguo 21/04/2011, 17:37
Lugaresdeambiente
 
Fecha de Ingreso: marzo-2011
Mensajes: 41
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: problema usando GET para la funcion Where en MYSQL

Gracias por responder amigo,,, Me sigue saliendo error, dice:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\directorio-listado.php on line 310

Las lineas son:

Código PHP:
 <?PHP
    
include("conexion.php");
    
$estado $_GET["estado"];
    
$q mysql_query ('SELECT `nombre`, `giro`, `estado`, `municipio`, `direccion`, `telefono`, `correo`, `web` FROM `negocios` WHERE $estado="$estado"  ORDER BY `nombre` ASC'); 

while (
$res mysql_fetch_assoc($q)) {
    
?>
    <table width="620" border="0" cellspacing="0" cellpadding="0">
.... " AQUI UNA TABLA LARGA, JEJEJEJEJE"....

              </table>
    <?      
}  



?>
Donde empieza el while es la linea 309, la 310 es donde esta " ?> "

Pero si quito la condicion While si funciona la consulta, mostrando todos los registros....

Que pasara???