DB Problem with CI 2.1.1 |
[eluser]cmh24[/eluser]
Hi everybody, just upgraded to CI 2.1.1 (like described in the userguide). Now I have the following problem with my database. I want to get all users who uploaded a photo. That means it is not empty. Code: $data['users'] = $this->db->where('user_photo !=', '')->get('users')->result(); But it does not work. With CI 2.1 it worked. Now I get an error message. 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 '`!=` ''' at line 3 SELECT * FROM (`users`) WHERE `user_photo` `!=` '' What changed? Looking forward to any help. Best regards! Max
[eluser]Otemu[/eluser]
Try this Controller: Code: $data['users']= $this->Users->getPhotos(); Model: Code: function getPhotos(()
[eluser]Linh Pham[/eluser]
[quote author="cmh24" date="1339578125"]Hi everybody, just upgraded to CI 2.1.1 (like described in the userguide). Now I have the following problem with my database. I want to get all users who uploaded a photo. That means it is not empty. Code: $data['users'] = $this->db->where('user_photo !=', '')->get('users')->result(); But it does not work. With CI 2.1 it worked. Now I get an error message. 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 '`!=` ''' at line 3 SELECT * FROM (`users`) WHERE `user_photo` `!=` '' What changed? Looking forward to any help. Best regards! Max[/quote] I am also getting this problem, who can i help you, please!
[eluser]moodh[/eluser]
Got the same problem as well. $this->db->where('start < ', time()); $this->db->where('end > ', time()); Gives me protect identifier errors, adding a FALSE to the third argument works. But seriously, I do not want to go through thousands of files to fix all these occurances. Stop breaking the framework when releasing a minor version, please. ![]()
[eluser]Unknown[/eluser]
[quote author="narcisha" date="1339594959"]Got the same problem as well. $this->db->where('start < ', time()); $this->db->where('end > ', time()); Gives me protect identifier errors, adding a FALSE to the third argument works. But seriously, I do not want to go through thousands of files to fix all these occurances. Stop breaking the framework when releasing a minor version, please. ![]() i had same problem to. and then i use /system/database/drivers/db_drivers.php from 2.1.0, problem solved, it seems it related to https://github.com/EllisLab/CodeIgniter/issues/1469 i hope they will fix it soon
[eluser]srpurdy[/eluser]
Same issue here. Why is it twice now minor releases break entire systems. It's completely crazy coding practices. Code: $query = $this->db Seem as though this version doesn't like ->get(); This query no longer works. 90% of my queries are written this way.. I guess I go back to 2.1.0...
[eluser]mcryan[/eluser]
I'm having the same problem. A lot of my queries are now broken, have to go back to 2.1.0. Even CI's session class is giving me problems: Code: DELETE FROM `ci_sessions` WHERE `last_activity` `< 1339662429`
[eluser]Phil Sturgeon[/eluser]
Related issues: https://github.com/EllisLab/CodeIgniter/issues/1469 https://github.com/EllisLab/CodeIgniter/issues/1471
[eluser]mcryan[/eluser]
Thanks Phil. Well download the update and give it a test. |
Welcome Guest, Not a member yet? Register Sign In |