Issue 262: issue with a call to a mysql database to create calendar events
Status:  Done
Owner: ----
Closed:  Dec 2009
Reported by kw4...@att.com, Dec 28, 2009
Trying to create calendar events using json-events.php but only works if 
there is only one record.  I must be going about this the wrong way.  
Thanks for any help.

events: "json-events.php",  ( This is my call from the HTML )

<?php
        $year = date('Y');
        $month = date('m');

$dbhost = 'localhost';
$dbuser = 'kw4691';
$dbpass = '33kiko';
$dbname = 'AB_CALENDER';

 $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error 
connecting to mysql');
 mysql_select_db($dbname);
 $query_header = "select id,bridge,start_time,end_time from 
calender_datas";
 $result_header= mysql_query($query_header,$conn);


while ($row1=@mysql_fetch_array($result_header, MYSQL_NUM)) {

        echo json_encode(array(

                array(
                        'id' => $row1[0],
                        'title' => "$row1[1]",
                        'start' => "$row1[2]",
                        'end' => "$row1[3]",
                        'url' => "http://yahoo.com/"
                )
        ));
}
?>

Dec 30, 2009
Project Member #1 adamrs...@gmail.com
you need to accumulate all the events into an array, and json_encode the entire array
at the very end. something like this:

$events = array()
while ($row1=@mysql_fetch_array($result_header, MYSQL_NUM)) {
                $events[] = array(
                        'id' => $row1[0],
                        'title' => "$row1[1]",
                        'start' => "$row1[2]",
                        'end' => "$row1[3]",
                        'url' => "http://yahoo.com/"
                );
}
echo json_encode($events);

Status: Done
Feb 23, 2010
#2 priti.so...@gmail.com
Hi,

Can following url can be parametrized

/myfeed.php?start=1262332800&end=1265011200&_=1263178646

as of now it is sending start and end by it's own I would like to give my own start
and end dates ??

Is this possible.If yes, then how can I achieve this.

Priti Solanki