Welcome Guest, Not a member yet? Register   Sign In
how can I create an empty database query object?
#2

[eluser]Thorpe Obazee[/eluser]
Code:
function getStuff( $id=false ) {
    if( !$id )    {
        return $this->db->query();
    }    else    {
// made some correction on the code
        return $this->db->get_where( 'stuff', array('id' => $id) );
}

I don't think I get the idea of returning of query object(I probably need to sleep.it's 1am here and I am hungry) but I'd return FALSE if I don't retrieve anything. and check from the function expecting it if it receives a boolean FALSE.


Messages In This Thread
how can I create an empty database query object? - by El Forum - 04-08-2009, 10:42 AM
how can I create an empty database query object? - by El Forum - 04-08-2009, 10:47 AM
how can I create an empty database query object? - by El Forum - 04-08-2009, 10:54 AM
how can I create an empty database query object? - by El Forum - 04-08-2009, 02:25 PM
how can I create an empty database query object? - by El Forum - 04-08-2009, 10:27 PM
how can I create an empty database query object? - by El Forum - 04-09-2009, 04:29 AM
how can I create an empty database query object? - by El Forum - 04-09-2009, 05:02 AM
how can I create an empty database query object? - by El Forum - 04-09-2009, 05:08 AM
how can I create an empty database query object? - by El Forum - 04-09-2009, 06:01 AM
how can I create an empty database query object? - by El Forum - 04-09-2009, 07:06 AM
how can I create an empty database query object? - by El Forum - 04-09-2009, 01:03 PM
how can I create an empty database query object? - by El Forum - 08-20-2012, 07:53 AM
how can I create an empty database query object? - by El Forum - 08-20-2012, 07:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB