Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/06/2012, 20:48
Avatar de xIamAlex
xIamAlex
 
Fecha de Ingreso: abril-2012
Ubicación: Venezuela
Mensajes: 118
Antigüedad: 12 años
Puntos: 23
Respuesta: Problema al mostrar datos de mysql en php

Cambia

Código PHP:
<html>  
<head><title>listado</title></head>  
<body>  
<?  
mysql_connect
("localhost","root","");  
$result=mysql_db_query("agenda","select * from amigos");?>  
<table>  
<tr><td>nombre</td><td>telefono</td></tr><?   
while ($row=mysql_fetch_array($result)){  
echo 
'<tr><td>'.$row["nombre"].'</td>';  
echo 
'<td>'.$row["telefono"].'</td>';}  
mysql_free_result($result)?>  
</table>  
</body>  
</html>
Por

Código PHP:
<html>  
<head><title>listado</title></head>  
<body>  
<?  
$conectar 
mysql_connect("localhost","root","");
mysql_select_db("agenda"$conectar);
$result=mysql_query("select * from amigos"$conectar);?>  
<table>  
<tr><td>nombre</td><td>telefono</td></tr><?   
while ($row=mysql_fetch_array($result)){  
echo 
'<tr><td>'.$row["nombre"].'</td>';  
echo 
'<td>'.$row["telefono"].'</td>';}  
mysql_free_result($result)?>  
</table>  
</body>  
</html>
Y luego prueba a ver si te funciona..
__________________
Las personas quieren autos, casas, teléfonos, dinero, poder, ser famosos, parejas, en fin.. yo solo quiero ser libre y feliz.