Basic SQL command will not return object |
I am trying to run a very basic query, and I can not get an object to return.. Other functions (using the same database) in this model work just fine, I am querying a MS-SQL database
PHP Code: function tmp2() Code: CodeIgniter: 3.1.6
@Juicepig,
Any plans to upgrade CI? Also, have you troubleshooted the $lines variable to see what value it is receiving? var_dump? Maybe this can help ( https://codeigniter.com/user_guide/datab...ry-results ). (02-12-2019, 08:15 AM)php_rocs Wrote: @Juicepig, var_dump($lines) returns bool(false) Table name changed for troubleshooting.. Still returns false when the code is simplified to: PHP Code: $lines = $this->db->query("select * from Util_TMP_Cal"); Still working on an upgrade from a year ago at the moment (see https://forum.codeigniter.com/thread-69978.html) (02-12-2019, 08:41 AM)php_rocs Wrote: @Juicepig, Yes, i think there is an issue with the data - for instance if I just select some columns, i get a valid result. Not sure why * will not work (* works in the SQL console) PHP Code: $lines = $this->db->select('hasWater,hasSewer')->from('UTIL_TMP_CALIB')->get();
@Juicepig,
The table name in all three post are spelled different. 1st post: Util_TMP_Calibrate 2nd post: Util_TMP_Cal 3rd post: UTIL_TMP_CALIB Also, make sure that the table name is not case sensitive. That would definitely cause problems. For MySQL, I always use lower case for table names and fields. (02-12-2019, 02:38 PM)php_rocs Wrote: @Juicepig, Yes, that was due to ongoing troubleshooting. At the time the code was run, the capitalization and table names were completely valid. The Solution appears to be an increase the SQL memory buffer in php.ini as follows. If there were more then a thousand entries or so, the results would be false, rather then a valid object. Code: memory_limit = 512M |
Welcome Guest, Not a member yet? Register Sign In |