2
I have a database with a date in the field start
, would like to display only the current month’s birthday fullcalendar
, but I’m having two difficulties:
select only the current month birthday
show birthdays in the corresponding month in the current calendar year, not in the original field year.
I currently have this code:
<?php
//Database
$data = array();
$link = mysqli_connect("localhost", "root", "", "agenda");
mysqli_set_charset($link, 'utf8');
if (!$link) {
echo "Error: Unable to connect to MySQL." . PHP_EOL;
echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
exit;
}
$query = "SELECT * FROM clientes";
if ($result = $link->query($query)) {
/* fetch object array */
while ($obj = $result->fetch_object()) {
$data[] = array(
'id' => $obj->id,
'title'=> $obj->title,
'start'=> $obj->start
);
}
/* free result set */
$result->close();
}
mysqli_close($link);
?>
<script>
$(document).ready(function() {
$('#clientes').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
defaultDate: '<?php echo date('Y-m-d');?>',
editable: true,
eventLimit: true, // allow "more" link when too many events
events : <?php echo json_encode($data);?>
});
});
</script>
And the show is like this:
I couldn’t understand the annual ordination you refer to...
– MagicHat
It’s because he gets the year that comes from the bank... only I was only wanting the month, I want to do a view for the birthday of the month. @Magic
– Mauro Santos