Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/01/2008, 08:54
Avatar de T4ke0veR
T4ke0veR
 
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
[AYUDA] Warning: mysql_fetch_assoc(): supplied argument is not a valid ...

Saludos,
bueno pro aqui otra vez con una de mis dudas :S:S... molestando como siempre..
bueno amigos estoy diseñando un sistema q me extraiga imagenes de la bade da datos en filas de 3 pero me da este error siguiente

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\wamp\www\Cersol\HTML\list_prod.php on line 30

Codigo:
Código PHP:
<?php include('Connections/connect.php');

// Variables de Configuración -----------------------------------
// Define el numero de Filas
$n_filas=3;

//***************************************************************
@$cat=$_REQUEST['passid'];
//$cat=1;

$fotos = array();
$sql="SELECT  *  FROM productos WHERE cat_id = $cat";
$sql_exec=mysql_query($sql);
    
/*while($row=mysql_fetch_assoc($sql_exec)){
            $tottal=mysql_affected_rows(); // Calculo el numero total de itms a listar
            }*/
$tottal=113;
// ------------------------------------------------------------------------------------------------------------------
$vert=$tottal/$n_filas;
$vert=round($vert);

?>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="5">
  <tr>
<td> <?php
        $a
=0;// Colocando el contador horizontal en 0
        
$i=1;// Colocando el contador vertical en 0
        
$w=0;//Colocando un contador para el mensaje de "No hay articulos en esta acategoria"
        
          
while($row=mysql_fetch_assoc($sql_exec)){
            
$w=w+1;
                if (
$a==0){
                echo 
'<tr><tr><tr><tr>';
                }
                
$a=$a+1;
                
$fotos[$i.'-'.$a] = $row['imagen'];
                
                echo 
"<td height='' width='550' border='0' ><a href='verimagen.php?pro_id=".$row['pro_id']."'><img src='images2/".$row['imagen']."' width='120' height='120' border='0'/></a><br>";?><?php echo $row['nombre'];
            
                
$r=$a;// contador remanente para listar imagenes sin exceso
                
                    
if ($a >= $n_filas) {
                    
$a=0;// reiniciando el contador horizontal
                    
$i=$i+1;// aumentando el contador vertical
                    
echo '</tr>';
                    } 
            if (empty(
$row)) {
        echo
"<table width='0' border='0' align='center' cellpadding='0' cellspacing='0'>
          <tr><br>
            <td width='550'><div align='center'>No hay articulos en esta categoria </div></td>
          </tr>
        </table>
        "
;
        break 
1;}
            
            }
            
         echo 
'</td><td></td>';
        
?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
Gracias!!!
__________________
Diseño gráfico, Web, imagen corporativa, publicidad ...