Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //birds_model.php (Array of Strings)
- class Birds_model extends CI_Model{
- function get_bird($q){
- $this->db->select('bird');
- $this->db->like('bird', $q);
- $query = $this->db->get('birds');
- if($query->num_rows > 0){
- foreach ($query->result_array() as $row){
- $row_set[] = htmlentities(stripslashes($row['bird'])); //build an array
- }
- echo json_encode($row_set); //format the array into json data
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement