Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/07/2012, 20:48
krloz1003
 
Fecha de Ingreso: agosto-2011
Mensajes: 11
Antigüedad: 15 años, 1 mes
Puntos: 1
Pregunta Error (Notice: Undefined offset: 21 in C:\xampp\htdocs\eventcal\calendar.php on line

Que tal amigo estoy intentanto realizar un calendario de eventos el problema que tengo que al ingresar un evento a la BD y mostrar el calendario me sale este error:

Notice: Undefined offset: 21 in C:\xampp\htdocs\eventcal\calendar.php on line 37

espero puedan ayudarme a dar solucion a este problema ya que se estaba tratando en el foro por juan007 pero ya lo cerraron y su solución no me funciona este es su link por si quieren consultar: http://www.forosdelweb.com/f18/notice-undefined-offset-20-c-wamp-www-portal-calendario-php-line-76-a-780129/

pongo el php que uso saludos:

Código PHP:
if(isset($_GET['time']))
    
$time = $_GET['time'];
else
    
$time = time();


$today = date("Y/n/j", time());

$current_month = date("n", $time);

$current_year = date("Y", $time);

$current_month_text = date("F Y", $time);

$total_days_of_current_month = date("t", $time);

$events = array();


$result = mysql_query("SELECT DATE_FORMAT(eventDate,'%d') AS day,eventContent,eventTitle FROM eventcal WHERE eventDate BETWEEN  '$current_year/$current_month/01' AND '$current_year/$current_month/$total_days_of_current_month'");

while(
$row_event = mysql_fetch_object($result))
{
    
//El error me lo marca en este linea de abajo
    
$events[intval($row_event->day)] .= '<li><span class="title">'.stripslashes($row_event->eventTitle).'</span><span class="desc">'.stripslashes($row_event->eventContent).'</span></li>';
}                            

$first_day_of_month = mktime(0,0,0,$current_month,1,$current_year);

 
0 (for Sunday) through 6 (for Saturday).
$first_w_of_month = date("w", $first_day_of_month);

//how many rows will be in the calendar to show the dates
$total_rows = ceil(($total_days_of_current_month + $first_w_of_month)/7);

//trick to show empty cell in the first row if the month doesn't start from Sunday
$day = -$first_w_of_month;


$next_month = mktime(0,0,0,$current_month+1,1,$current_year);
$next_month_text = date("F \'y", $next_month);

$previous_month = mktime(0,0,0,$current_month-1,1,$current_year);
$previous_month_text = date("F \'y", $previous_month);

$next_year = mktime(0,0,0,$current_month,1,$current_year+1);
$next_year_text = date("F \'y", $next_year);

$previous_year = mktime(0,0,0,$current_month,1,$current_year-1);
$previous_year_text = date("F \'y", $previous_year);
?>