xml_from_result error |
[eluser]escape[/eluser]
With the following: Code: $this->load->dbutil(); I'm getting the following error: Quote:You must submit a valid result object If I change the result to csv like: Code: echo $this->dbutil->csv_from_result($query); I would assume xml_from_result would generate xml but instead I'm getting an error. Suggestions to this error message? Thanks
[eluser]jtkendall[/eluser]
I tried your code and got the same issue after a quick search on the forums I found this post. Which recommends changing line 220 in /system/database/DB_utility.php to Code: if ( ! is_object($query) OR ! method_exists($query, 'list_fields')) I tried that and it worked seems there was a change between 1.6.3 which caused it to break.
[eluser]escape[/eluser]
You will note from the referenced post I was the last to reply regarding Code: if ( ! is_object($query) OR ! method_exists($query, 'list_fields')) However it does not repair the xml_from_result error I'm reporting.
[eluser]jtkendall[/eluser]
Yeah, I realized you were the last to reply on that post. However, I tried the basic xml_from_result() example you posted and it failed with the same error. I made the same change the reference post mentions in the xml_from_result() method in /system/database/DB_utility.php and it DID fix the issue. The referenced post solution mentioned line 178 which is the csv_from_result() method, line 220 (that I mentioned) is for the xml_from_result() method.
[eluser]escape[/eluser]
Unfortunately I cannot reproduce your results. I installed a fresh version of CI and tested the following code: Code: $this->load->database(); on two shared hosting accounts (one Linux and one Windows OS) and another on a desktop server using XAMPP. All three installations were modified to include the recommended patch to fix csv Code: if ( ! is_object($query) OR ! method_exists($query, 'result_object')) Each installation was able to create csv but not xml. Quote:note: both 'result_object' and 'list_fields' repair csv but not xml
[eluser]docevi1[/eluser]
I had this problem too with CodeIgniter 1.7.1. I changed line 220 in /system/database/db_utility.php from if ( ! is_object($query) OR ! method_exists($query, 'field_names')) to if ( ! is_object($query) OR ! method_exists($query, 'row')) This solved my problem. |
Welcome Guest, Not a member yet? Register Sign In |