[eluser]!Z[/eluser]
This query on MySQL works fine but when I create this one on CI with Active Record Class
throw an exception on the query.
MySQL Query
Code:
select users.ID, users.FirstName, users.LastName, users.EMail, users.Username, users.Pwd,
users.City, users.ZipCode,DATE_FORMAT(users.FecNac,'%d/%m/%y') as 'FecNac', users.Tall, users.Weight, users.Gender,
usersprofile.IDTypeContext, usersprofile.IDTypeAC,usuariosperfiles.NewsLetter,
usersprofile.Offers, usersprofile.BodyOffers, usersprofile.YearsOverWeight, usersprofile.CantSons
from users
inner join usersprofile on users.ID = usersprofile.IDUser
Active Record Class
Code:
$this->db->select("select users.ID, users.FirstName, users.LastName, users.EMail, users.Username, users.Pwd,
users.City, users.ZipCode,DATE_FORMAT(users.FecNac,'%d/%m/%y') as 'FecNac', users.Tall, users.Weight, users.Gender,
usersprofile.IDTypeContext, usersprofile.IDTypeAC,usuariosperfiles.NewsLetter,
usersprofile.Offers, usersprofile.BodyOffers, usersprofile.YearsOverWeight, usersprofile.CantSons");
$this->db->join("usersprofile","users.ID = usersprofile.IDUsers");
$this->db->where("users.ID",1);
return $this->db->get("users")->row();
I think this is because in the DB_active_rec.php file in the line 83 has this sentence
Code:
$select = explode(',', $select);
I think the CI guys could improve it to get a fully compatibility with MySQL and his functions.
I know that I can format the date from the php code,but I want to do this from mysql.
Anyone knows if there is some solution?
Thanks ;-)