Last active
October 10, 2015 19:27
-
-
Save andyhawthorne/3739207 to your computer and use it in GitHub Desktop.
method for counting search results
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_record_count($searchterm) | |
| { | |
| $sql = "SELECT COUNT(*) As cnt FROM Country | |
| WHERE Continent LIKE '%" . $searchterm . "%'"; | |
| $q = $this->db->query($sql); | |
| $row = $q->row(); | |
| return $row->cnt; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment