Ver Mensaje Individual
  #5 (permalink)  
Antiguo 29/03/2007, 22:40
Avatar de mlorena
mlorena
 
Fecha de Ingreso: marzo-2007
Mensajes: 16
Antigüedad: 18 años
Puntos: 0
Re: Error fetch_assoc()

Pues asi fue como se corrigio... en el manual de php.net viene...

Código:
if(isset($_SESSION['user']))
   {
    $obj = new DatabaseConnection();
    $lnk = $obj->getConnection(); 
    if(!is_null($lnk))
    { 
      $query = "select Fot_Url as url from soy_foto where Us_Usuario = '".$_SESSION['user']."';";
      if ($result = $lnk->query($query))   //aqui fue donde cambio
      { 
        if($row = $result->fetch_assoc())  //aqui
        {
          echo("<img src='../Agrega_Foto/".$row['url']."' width='190' height='198' /></p>");
         }
         else
         {
           echo("<img src='../Pictures/Agrega_Foto_green.png' width='190' height='198' /></p>");
          }
       $result->close();
       }//End of if.
     $lnk->close();  //y se agregaron los close de $result y $lnk