Last active
October 10, 2015 19:27
-
-
Save andyhawthorne/3739236 to your computer and use it in GitHub Desktop.
search method
This file contains hidden or 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 | |
| public function search($searchterm,$limit) | |
| { | |
| $sql = "SELECT * FROM Country | |
| WHERE Continent LIKE '%" . $searchterm . "%' LIMIT " .$limit . ",20"; | |
| $q = $this->db->query($sql); | |
| if($q->num_rows() > 0) | |
| { | |
| foreach($q->result() as $row) | |
| { | |
| $data[] = $row; | |
| } | |
| return $data; | |
| } | |
| else | |
| { | |
| return 0; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment