i am new to php and i am trying to write a function which will get all the results from the reviews
mysql table. I have posted what i have tried but its saying i have a problem on line 101 which is the "$sql = 'SELECT * FROM reviews WHERE id = "'.$review_id.'";'"
and i cant see what the problem is can someone help please. im using apigee to test the api
/*reviews*/
function reviews_get() {
$this->load->database();
$sql = 'SELECT * FROM reviews;';
$query = $this->db->query($sql);
$data = $query->result();
$this->response($data, 200);
}
function review_get($review_id) {
$this->load->database();
$sql = 'SELECT * FROM reviews WHERE id = "'.$review_id.'";';
$query = $this->db->query($sql);
$data = $query->row();
$this->response($data, 200);
}