Ver Mensaje Individual
  #3 (permalink)  
Antiguo 20/11/2012, 10:45
rascabuchitos
 
Fecha de Ingreso: abril-2011
Ubicación: Peru
Mensajes: 486
Antigüedad: 13 años
Puntos: 9
Respuesta: consulta en mysql

hola maycolalvarez

aqui
esta el codigo original

Código PHP:
<?php
require("conexion.php");
require(
"funciones.php");

$query "SELECT * FROM empresa ORDER BY nombre ASC";
$queEmp 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: Consultar datos en MySQL</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h3>Listado de  Empresas</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 ($rsEmp mysql_fetch_assoc($queEmp)) { ?>
  <tr>
    <td><?php echo $rsEmp['nombre']; ?></td>
    <td><?php echo $rsEmp['direccion']; ?></td>
    <td><?php echo $rsEmp['telefono']; ?></td>
  </tr>
  <?php ?>
</table>


y esto es mi arreglo
agradeceria mucho tu correcion

Código PHP:
<?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>
[B]<?php while ($rsusuario mysql_fetch_assoc($queusuario)) { ?>[/B]
<tr>
<td><?php echo $rsusuario['nombre']; ?></td>
<td><?php echo $rsusuario['direccion']; ?></td>
<td><?php echo $rsusuario['telefono']; ?></td>
</tr>
<?php ?>
</table>