[eluser]kmil0[/eluser]
Hi guys.
I have a strange problem when i use $this->db->select()
I have something like this
Code:
$query = $this->db->select(
array(
"u.name_u as name",
"DATE_FORMAT(u.date_field, '%Y-%d-%m %H:%i%s') as date_field"
)
);
$query = $this->db->join("rol r", "r.code_r = u.cod_rol");
$query = $this->db->get("users u", $offset, $lenght);
but, i got a "Database error number 1064"
and this is the final query:
Code:
SELECT u.name_u AS name, creditex_DATE_FORMAT(u.date_field, '%Y-%d-%m %H:%i%s'\) as date_field FROM (`creditex_users` u) JOIN `creditex_rol` r ON r.codigo_r = u.cod_rol LIMIT 0, 5
look that SELECT add the the dbprefix to MySql DATE_FORMAT function, and is the same with STR_TO_DATE
What could be happening?
thank's guys
excuse my bad english