Created
May 1, 2017 07:22
-
-
Save whoami15/8eeb644e85f699f4d2a043a09624050a to your computer and use it in GitHub Desktop.
COntroller & model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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