Bueno mi codigo es este y tengo un problema al conectarme a la base de datos pues quiero llamar los eventos de mi tabla y mostrarlos en el calendario , quiza mi error sea claro..pero como ya habia comentado estoy iniciandome en el lenguaje php.
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.print.css' media='print' />
<script type='text/javascript' src='../jquery/jquery-1.7.1.min.js'></script>
<script type='text/javascript' src='../jquery/jquery-ui-1.8.17.custom.min.js'></script>
<script type='text/javascript' src='../fullcalendar/fullcalendar.min.js'></script>
<script type='text/javascript'>
<?php
$(document).ready(function() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
$start = $_GET['start'];
$end = $_GET['end'];
$hostname="localhost";
$username="root";
$password="";
$dbname="wdcalendario";
mysql_connect($hostname, $username, $password) or die("Unable to connect!");
mysql_select_db($dbname);
$result = mysql_query("select * from jqcalendar");
$event_array = array();
while ($record = mysql_fetch_array($result)) {
$event_array[] = array(
);
editable: true,
events: [
{
title: $record['id'],
start: $record['startTime'],
end: $record['endTime'],
},
{
title: $record['subject'],,
start: $record['startTime'],
end: $record['endTime'],
},
{
id: 999,
title: $record['location'],
start: $record['startTime'],
end: $record['endTime'],
},
{
id: 999,
title: $record['description'],
start: $record['startTime'],
end: $record['endTime'],
}
]
});
});
}
?>
</script>
<style type='text/css'>
body {
margin-top: 40px;
text-align: center;
font-size: 14px;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}
#calendar {
width: 900px;
margin: 0 auto;
}
</style>
</head>
<body>
<div id='calendar'></div>
</body>
</html>