Welcome Guest, Not a member yet? Register   Sign In
Database query problems
#1

[eluser]nmormino[/eluser]
I tried using the database helper to write a query that would ultimately have the same function as

SELECT * FROM table_name WHERE date >= CURDATE()

I made an attempt at this by using

$this->db->where("date >= "=>date('Y-m-d'));
$this->db->orderby('date DESC');
$query = $this->db->get('table_name');

But this didn't return anything where as the manual SQL statement does return results.

any ideas?
#2

[eluser]alexsancho[/eluser]
try this

Code:
$this->db->where("date >=", date('Y-m-d'));
$this->db->orderby('date', 'desc');
$query = $this->db->get('table_name');
#3

[eluser]nmormino[/eluser]
that did it!

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB