CodeIngiter Query: 0 results. Pasting same query into query tool: 1 result. Uh... what? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: CodeIngiter Query: 0 results. Pasting same query into query tool: 1 result. Uh... what? (/showthread.php?tid=11139) |
CodeIngiter Query: 0 results. Pasting same query into query tool: 1 result. Uh... what? - El Forum - 08-27-2008 [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){ 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? CodeIngiter Query: 0 results. Pasting same query into query tool: 1 result. Uh... what? - El Forum - 08-27-2008 [eluser]absurdparadox[/eluser] Also, I should mention, replacing the double ->where on the second query with only one where using an array did not fix it. CodeIngiter Query: 0 results. Pasting same query into query tool: 1 result. Uh... what? - El Forum - 08-27-2008 [eluser]absurdparadox[/eluser] Hmm, it seems you can't set array elements to the object in the manner I was trying. Or rather, they were setting, but the second items query was empty. I don't know if this is a restriction of the way code igniter is built or something to do with php itself (I'm very new to PHP). When I changed it to the following, it works fine. Code: function pageinfo($page, $subpage){ CodeIngiter Query: 0 results. Pasting same query into query tool: 1 result. Uh... what? - El Forum - 08-27-2008 [eluser]Eric Cope[/eluser] I have issues with arrays of objects or arrays of mixed types. Glad to see you found a work around. On a side note, isn't it fun to talk to yourself on a forum? |