Skip to content

Instantly share code, notes, and snippets.

@alexedwards
Created July 27, 2010 16:36
Show Gist options
  • Save alexedwards/492478 to your computer and use it in GitHub Desktop.
Save alexedwards/492478 to your computer and use it in GitHub Desktop.
<?php
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// VARIOUS FIND FUNCTIONS
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function find($id)
{
$query = $this->db->where($this->primary_key, $id)
->get($this->table);
if ($query->num_rows() == 1)
{
return $query->row();
}
return FALSE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment