![]() |
why wont this query return any results - 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: why wont this query return any results (/showthread.php?tid=43091) |
why wont this query return any results - El Forum - 06-29-2011 [eluser]Uplift[/eluser] Any idea why this query wont return any results.. probably something stupid but i can't see it. Code: function getUpcoming() { this should select the title and datet from the events table if datet is less than or equal to $todaysDate basically, it should show all events that haven't happened yet. I also want to limit it to 10 results ordered by date (closest event first) I have used $queryUp because i already have a query above using $query to return other results, do i need to do that? why wont this query return any results - El Forum - 06-29-2011 [eluser]cideveloper[/eluser] set Code: $this->output->enable_profiler(TRUE); and see what query is being generated. Then try that query directly in you database and see if you get a result. why wont this query return any results - El Forum - 06-29-2011 [eluser]Seb[/eluser] You should try this: Code: $queryUp = $this->db->get_where('events', array('datet <=' => $todaysDate)); And by the way, the variable needs to have another name only if you care about the previous result set. why wont this query return any results - El Forum - 06-29-2011 [eluser]adityamenon[/eluser] You could also try Code: $this->db->last_query(); exit(); |