Welcome Guest, Not a member yet? Register   Sign In
How to avoid ugly 'Error Number: 1146' (database) errors
#3

[eluser]Zeff[/eluser]
Hi jairoh_,

The called (working) model method in my case is:
<code>
public function get_all_results($id='')
{

if($id!='')
{
$id = intval($id);
$query = $this->db->get_where('mytable', array('id' => $id));
}
else
{
$this->db->order_by('year', 'acs');
$query = $this->db->get('mytable');
}

if($query->num_rows() > 0) return $query->result_array();

return false;
}

</code>

Cheers,

Zeff


Messages In This Thread
How to avoid ugly 'Error Number: 1146' (database) errors - by El Forum - 08-02-2013, 04:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB