
20/11/2012, 09:19
|
| | Fecha de Ingreso: abril-2011 Ubicación: Peru
Mensajes: 486
Antigüedad: 13 años, 11 meses Puntos: 9 | |
consulta en mysql Hola amigos
porque me sale esto:
se que Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in/home/select-demo2.php on line 23
se que dice que la consulta Mysql no devolvio ningun dato.
pero como lo resuelvo?
aqui el codigo
<?php
require("conexion.php");
require("funciones.php");
$query = "SELECT * FROM usuario ORDER BY nombre ASC";
$queusuario = mysql_query($query, $conexion);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>PHP con MySQL: Consulus en MySQL</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h3>Listado de Usuarios</h3>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>Nombre</th>
<th>Dirección</th>
<th>Teléfono</th>
</tr>
<?php while ($rsusuario = mysql_fetch_assoc($queusuario)) { ?>
<tr>
<td><?php echo $rsusuario['nombre']; ?></td>
<td><?php echo $rsusuario['direccion']; ?></td>
<td><?php echo $rsusuario['telefono']; ?></td>
</tr>
<?php } ?>
</table>
Gracias |