Skip to content

Instantly share code, notes, and snippets.

@andyhawthorne
Last active December 20, 2015 21:28
Show Gist options
  • Save andyhawthorne/6197504 to your computer and use it in GitHub Desktop.
Save andyhawthorne/6197504 to your computer and use it in GitHub Desktop.
<?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