Precedence unknown column when using find_one()

edited November 2014 in Modules
When I run the code below, I get an error saying precedence is an unknown column. Indeed, I did not include the precedence column in my table and I have no intention to. Is there anyway to prevent ordering by precedence? I tried to set the second parameter to an empty string, but still no luck. Also, oddly, when I don't set the return value to array, it returns as an object. Anyone else having this issue?

$envelope = $CI->envelopes_model->find_one(array('reference_number' => $values['reference_number']), '', 'array');

Comments

  • edited 11:33AM
    Remove it from the _common_query() method in your model would be my guess. If you generated the model, it is there by default and will need to be removed.
  • edited 11:33AM
    Is this what you meant? I tried it with no luck:

    function _common_query() { parent::_common_query(); $this->db->order_by(''); }
  • edited 11:33AM
    My mistake--I was looking at the wrong model file. That worked great. =)
Sign In or Register to comment.