Ver Mensaje Individual
  #4 (permalink)  
Antiguo 26/11/2011, 20:35
ultratutu9
 
Fecha de Ingreso: noviembre-2011
Mensajes: 26
Antigüedad: 14 años, 11 meses
Puntos: 2
Respuesta: Problema con la funcion shuffle

Mira NULL significa que no tiene ningun valor, y si creas una variable que no tiene valor te daria error.Te voy a marcar las lineas donde puede estar el error.
Código PHP:
//De aca o anteriores
$query_productos = "SELECT * FROM producto_productos WHERE IDProducto_Catalogo = '" . $row_catalogo['IDProducto_Catalogo'] . "'";
        
$res_productos = $mysql->query($query_productos, false);
        while(
$row_productos = mysql_fetch_array($res_productos)){
            
$arreglo_prod[] = $row_productos['IDProducto_Producto'];
        }
//Hasta aca

    ////    Esta es la lina 381
$arreglo_prod[] = shuffle($arreglo_prod);
//////////
        
$ultimo_prod = array_pop($arreglo_prod);
        
$formacion_cat = ($row_catalogo['Formacion_catalogo'] == "Tipo4") ? 1 : 2;
        
$cuantos_prod_por_fila = 3;

        if(
$totalRows_catalogo != 0){
            if(
$row_catalogo['Formacion_catalogo'] == "Tipo4"){
                for(
$i_cat = 0; $i_cat < $cuantos_prod_por_fila; $i_cat++){
                    if(
$arreglo_prod[$i_cat]){
                        
                        
$query_prod = "SELECT * FROM producto_productos WHERE IDProducto_Producto = '" . $arreglo_prod[$i_cat] . "'";
                        
$row_prod = $mysql->query($query_prod);
                        
                        
$query_general_catalogo = "SELECT * FROM producto_catalogos WHERE IDProducto_Catalogo = '" . $row_prod['IDProducto_Catalogo'] . "'";
                        
$row_general_catalogo = $mysql->query($query_general_catalogo);
                        
                        
$liga_demo_popup = "index.php?id_seccion=" . $id_seccion . "&id_subseccion=" . $id_subseccion . "&IDProducto_Catalogo=" . $row_catalogo['IDProducto_Catalogo'] . "&IDProducto_Producto=" . $row_prod['IDProducto_Producto'] . "&agregado=" . $row_catalogo['Nombre'];
    
?> 
Dame las lineas anteriores para saber si esta antes el error y no fijarnos tanto ahi.
Salu2 ultratutu9