Welcome Guest, Not a member yet? Register   Sign In
why wont this query return any results
#1

[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->db->order_by("datet", "desc");
        $this->db->select('title, datet');
        $todaysDate = date('Y-m-d');
        $queryUp = $this->db->get_where('events', array('datet' => '<= $todaysDate'));
        
        return $queryUp->result_array();
    
    }

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?


Messages In This Thread
why wont this query return any results - by El Forum - 06-29-2011, 02:10 PM
why wont this query return any results - by El Forum - 06-29-2011, 02:31 PM
why wont this query return any results - by El Forum - 06-29-2011, 03:27 PM
why wont this query return any results - by El Forum - 06-29-2011, 07:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB