Welcome Guest, Not a member yet? Register   Sign In
CodeIngiter Query: 0 results. Pasting same query into query tool: 1 result. Uh... what?
#1

[eluser]absurdparadox[/eluser]
Strange issue going on here. I've got one query thats giving me 0 results in CodeIgniter, and 1 result in pgAdmin (postgresql).

Here's the php:
Code:
function pageinfo($page, $subpage){
        $arrReturn = array();
        $arrReturn['page']=$this->db->select('*')->from('tblcategory')->where('urlkeyword',$page)->get();
        $parentid=$arrReturn['page']->row()->id;
        $arrReturn['subpage']=$this->db->select('*')->from('tblcategory')->where('urlkeyword',$subpage)->where('parentid',$parentid)->get();
        echo $this->db->last_query();
        return $arrReturn;
    }

The first query works fine. Second query returns no results.

The query being returned from the last_query() echo:

Code:
SELECT * FROM "tblcategory" WHERE "urlkeyword" = 'test1' AND "parentid" = '0baaf830-68bb-11dd-ad8b-0800200c9a66'

Pasting this exact query into pgadmin, it gives me a result. How is this possible...? Maybe I am simply doing something wrong here?


Messages In This Thread
CodeIngiter Query: 0 results. Pasting same query into query tool: 1 result. Uh... what? - by El Forum - 08-27-2008, 11:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB