Ver Mensaje Individual
  #3 (permalink)  
Antiguo 28/05/2013, 12:04
Avatar de iEnrique
iEnrique
 
Fecha de Ingreso: abril-2013
Ubicación: España
Mensajes: 346
Antigüedad: 11 años
Puntos: 5
Respuesta: Creo que lo tengo todo bien, ¿hay algo mal?

Le he puesto lo que has dicho definiendo la variable $variableConexion y pone el siguiente error:

Código PHP:
Código PHP:
Ver original
  1. $variableConexion = mysql_connect("localhost", "root", "");
  2.                 $sql = "SELECT nombre FROM reg_users WHERE user='$_SESSION[usuario]'";
  3.                 $consulta = mysql_query($sql,$variableConexion);
  4.                 while($rs=mysql_fetch_array($consulta)){
  5.                     echo $rs['nombre'];
  6.                 }

Error:

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Lemite\index.php on line 120


Que cae en esta línea:
Código PHP:
Ver original
  1. while($rs=mysql_fetch_array($consulta)){

Creo que es el mismo error de antes...