Skip to content

Instantly share code, notes, and snippets.

@whoami15
Created May 1, 2017 07:22
Show Gist options
  • Save whoami15/8eeb644e85f699f4d2a043a09624050a to your computer and use it in GitHub Desktop.
Save whoami15/8eeb644e85f699f4d2a043a09624050a to your computer and use it in GitHub Desktop.
COntroller & model
<?php
//controller
public function getEvents()
{
$result=$this->Calendar_model->getEvents();
echo json_encode($result);
}
//model
public function getEvents()
{
$sql = "SELECT * FROM events WHERE events.date BETWEEN ? AND ? ORDER BY events.date ASC";
return $this->db->query($sql, array($_GET['start'], $_GET['end']))->result();
}
array($_GET['start'], $_GET['end'])) // i dont know what to change here whe u get this?
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment