MSSQL - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: MSSQL (/showthread.php?tid=6701) |
MSSQL - El Forum - 03-08-2008 [eluser]polaris1927[/eluser] i have noted that in version 1.6.1 the mssql_driver module substitues single quote marks with double quotes after the FROM statement. For example: Code: $query = $this->db->get('business_names'); will generate a query string like this: Code: SELECT * FROM business_names However the same code will generate the following: Code: SELECT * FROM "business_names" I know what the issue is but cannot track it down inside the relevant modules. Has anyone noticed this error and found a workaround? Thanks. JG MSSQL - El Forum - 03-08-2008 [eluser]polaris1927[/eluser] Discovered the cause. Version 1.6.0, Module: mssql_driver Code: function _protect_identifiers($item, $affect_spaces = TRUE, $first_word_only = FALSE) Was replaced in Version 1.6.1 with: Code: function _protect_identifiers($item, $first_word_only = FALSE) For a quick fix i reverted to the 1.6.0 code. JC MSSQL - El Forum - 03-13-2008 [eluser]mr.zeno[/eluser] Hi to all, I am new to the CodeIgniter community (actually doing my first php project since *ages*, been doing a lot of java, c# and other stuff). I had the same problem, the 'fix' polaris posted works with me. I do wonder however how this might affect other procedures in the mssql_driver.. Anyone who can tell me more about that? MSSQL - El Forum - 03-13-2008 [eluser]Pygon[/eluser] only one line is the cause -- a search of this forum or the bug report forum or the bug system would have given you the answer. MSSQL - El Forum - 03-13-2008 [eluser]mr.zeno[/eluser] A search in this forum brought me to this thread I'll checkout the bug-system then.. MSSQL - El Forum - 03-13-2008 [eluser]mr.zeno[/eluser] Jup! it was in there: http://codeigniter.com/bug_tracker/bug/3472/ the fix is posted here (confirmed by administrator): http://ellislab.com/forums/viewthread/71558/#353513 MSSQL - El Forum - 03-13-2008 [eluser]polaris1927[/eluser] [quote author="mr.zeno" date="1205456000"]Jup! it was in there: http://codeigniter.com/bug_tracker/bug/3472/ the fix is posted here (confirmed by administrator): http://ellislab.com/forums/viewthread/71558/#353513[/quote] This fix did not work for me. MSSQL - El Forum - 03-13-2008 [eluser]polaris1927[/eluser] With the posted fix I have two generated queries having different syntax: The following ws generated from the profiler: Code: 0.0011 SELECT * FROM business_numbers WHERE name_id = '2' The PHP code that was used is shown below: Code: $data['phonenumbers'] = $this->db->get_where('business_numbers', array('name_id' => $contact_id) ); Not much difference, but I still get the "" (double quotes) shown for "id", which seems strange. Can anyone verify what I have found? MSSQL - El Forum - 03-13-2008 [eluser]polaris1927[/eluser] In module mssql_driver.php, where you see the line (near line 467) Code: return "\"{$item}\""; replace with Code: return $item; MSSQL - El Forum - 08-19-2008 [eluser]mr.zeno[/eluser] Too bad this 'bug' still exists as of version 1.6.3 |