Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/02/2008, 07:19
maitep
 
Fecha de Ingreso: septiembre-2006
Mensajes: 116
Antigüedad: 17 años, 8 meses
Puntos: 1
problema con Undefined offset

hola tengo el siguinte código y me da un fallo con una comparacion en un while
el error es el siguiente

Notice: Undefined offset: 4 in /home/2006/a003423/public_html/libro1/modulos/insertar/insertar.php on line 58

Notice: Undefined offset: 4 in /home/2006/a003423/public_html/libro1/modulos/insertar/insertar.php on line 68

el código es este

Código PHP:
                    $i=0;
                    while((
$i <= 9)&&($array_categoria[$i] != null)){
                            if(
$array_categoria[$i]!=$nuevo_cate){ // si las categorias son distintas
                            
$i++;
                            }else{
                                if(
$array_categoria[$i]==$nuevo_cate){
                                echo 
"Esa Categoria ya esta creada";
                                
$i=11;
                                }
                            }
                        }
                    if ((
$i <= 9)&&($array_categoria[$i] == null)){ //encontre hueco vacío
                        
$array_categoria[$i]=$nuevo_cate;
                    } 
muchas gracias