Tema: Mysql Error
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/05/2010, 13:43
Avatar de Lautaro_eb
Lautaro_eb
 
Fecha de Ingreso: mayo-2010
Ubicación: Bariloche, Argentina
Mensajes: 284
Antigüedad: 14 años
Puntos: 24
Mysql Error

Buenas Segui paaso a Paso El http://www.forosdelweb.com/wiki/Manual_de_PHP:_MySQL#SELECT:_Obtener_los_datos
Código PHP:
<?php
$conexion 
mysql_connect('localhost''root''root');
mysql_select_db('pricipal',$conexion);
$query "SELECT * FROM comentarios";
$resultado mysql_query($query,$conexion) or die(mysql_error());
$total mysql_num_rows($resultado);
?>
<head>
<meta http-equiv="Content-Type" content="Text//html;"/>
<title>Ejemplo De Conexion a MYSQL</totle>
</head>
<body>
<h1>Resultado</h1>
<?php
if($total>0)
{
     while(
$file mysql_fetch_assoc($resultado))
     {
             echo
"<strong>"$fila['nombre']."</strong><br />";
             echo
"Email: "$fila['email']."<br>";
             echo
"<strong>"$fila['comentario']."<br";
             echo
"Email: "$fila['estado']."<br><br>";
     }
}
?>
</html>
</body>
Me tira los SIguientes error
Código:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in D:\AppServ\www\index.php on line 2

Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in D:\AppServ\www\index.php on line 3

Warning: mysql_query() expects parameter 2 to be resource, boolean given in D:\AppServ\www\index.php on line 5
Access denied for user 'root'@'localhost' (using password: YES)

Última edición por Lautaro_eb; 25/05/2010 a las 13:49