Skip to content

Instantly share code, notes, and snippets.

@phawk
Created January 15, 2012 12:18
Show Gist options
  • Select an option

  • Save phawk/1615680 to your computer and use it in GitHub Desktop.

Select an option

Save phawk/1615680 to your computer and use it in GitHub Desktop.
<?php
public function get_record( $primary_value )
{
$this->db->where( $this->primary_key, $primary_value );
$this->db->from( $this->table_name );
$query = $this->db->get();
if( $query->num_rows() === 1 )
{
return $query->row();
}
else
{
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment