Query in codeigniter |
Hello, i'm trying to compare a date from database with my variable. But doesn't work.
PHP Code: $query = $this->db->get('chamadas'); A Database Error Occurred Error Number: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as data_chamada '06-08-2015'' at line 3 SELECT *, DATE_FORMAT(data_chamada, '%d-%m-%Y') as 'data_chamada' FROM `chamadas` WHERE DATE_FORMAT(data_chamada, '%Y-%m-%d') as data_chamada '06-08-2015' Filename: C:/wamp/www/projetowebconf/application/models/historico_model.php Line Number: 13 Can anyone help me?
I got it.
I fomated my date before query. $date = date("Y-m-d", strtotime($codigo)); |
Welcome Guest, Not a member yet? Register Sign In |