Tema: error mysql
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/04/2015, 22:13
Omarchikis
 
Fecha de Ingreso: enero-2014
Mensajes: 4
Antigüedad: 11 años, 1 mes
Puntos: 0
Pregunta error mysql

Que tal

Dispculpen estoy en un problema bastante horroroso trato de hacer un menu dinamico con php y mysql pero me da error

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\prueba\WEB\menu.php on line 5

Index


Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\prueba\WEB\menu.php on line 22

he revisado y me indica que el codigo esta bien escrito

<?php
require_once("conexion.php");
$consulta= "SELECT * FROM menu WHERE estado =1";
$res = mysql_query($consulta,$conexion);
$cant = mysql_num_rows($res);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="estilos.css"/>
<title>Principal</title>
</head>

<body>
<div id="contenedor">
<header>
<h1>Index</h1>
</header>
<nav>
<ul>
<?
while($fila = mysql_fetch_array($res))
{
echo '<li><a href="#">'.$fila['nombreMenu'].'</a></li>';
}
?>
</ul>
</nav>
</div>
</body>
</html>


lo estoy haciendo en appserv 2.5
espero me puedan ayudar
desde ya GRACIAS