![]() |
Database Error w/o error number in the DB_driver.php - 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: Database Error w/o error number in the DB_driver.php (/showthread.php?tid=47389) |
Database Error w/o error number in the DB_driver.php - El Forum - 12-06-2011 [eluser]Unknown[/eluser] I'm new to Oracle and I'm using Wamp. I already have an existing connection between CI using Wamp and MySql, and now I'm required to connect it to Oracle. I'm getting this error and I can't find any solutions yet (I've searched on some posts already). Quote:A Database Error Occurred Can someone help me on this? ![]() ![]() This is the code in line 330: Code: if (FALSE === ($this->result_id = $this->simple_query($sql))) Database Error w/o error number in the DB_driver.php - El Forum - 07-19-2012 [eluser]Unknown[/eluser] [quote author="ndsadona" date="1323218468"]I'm new to Oracle and I'm using Wamp. I already have an existing connection between CI using Wamp and MySql, and now I'm required to connect it to Oracle. I'm getting this error and I can't find any solutions yet (I've searched on some posts already). Quote:A Database Error Occurred Can someone help me on this? ![]() ![]() This is the code in line 330: Code: if (FALSE === ($this->result_id = $this->simple_query($sql))) Hi! I know that this problem its old, but I just want to explain a little bit the real problem here. Please, look at the SQL query generated by CI: Code: SELECT * FROM "project_users" WHERE "userid" = 'user1' AND "password" = 'iamuser1' Note that the table names and table fields has double quotes, and that the reason of the issue: in a oracle SQL query, you DONT escape the name of the identifiers. Looking in the source of CI, de base class CI_DB has a flag indicating that identifiers MUST be escaped. This is not necessary in Oracle, so i just add this attribute in system/database/drivers/oci8_diver.php... Code: var $_protect_identifiers = FALSE; (If someone else want to test it, I put the line above before the method db_connect() on the OCI 8 Driver). After that, I can use the models and querys exactly the same as the tutorial shows: Code: <?php Regards Database Error w/o error number in the DB_driver.php - El Forum - 09-16-2012 [eluser]Unknown[/eluser] [quote author="Lehbyos" date="1342713329"][quote author="ndsadona" date="1323218468"] Note that the table names and table fields has double quotes, and that the reason of the issue: in a oracle SQL query, you DONT escape the name of the identifiers. Looking in the source of CI, de base class CI_DB has a flag indicating that identifiers MUST be escaped. This is not necessary in Oracle, so i just add this attribute in system/database/drivers/oci8_diver.php... Code: var $_protect_identifiers = FALSE; (If someone else want to test it, I put the line above before the method db_connect() on the OCI 8 Driver). After that, I can use the models and querys exactly the same as the tutorial shows: Code: <?php Regards[/quote] Thanks Lehbyos, I tried it on my local machine and it is working correctly right now ![]() Database Error w/o error number in the DB_driver.php - El Forum - 10-17-2013 [eluser]Unknown[/eluser] This is brilliant - and it fixed my Oracle / CI problem. Thanks! [quote author="Lehbyos" date="1342713329"][quote author="ndsadona" date="1323218468"] (snip) Please, look at the SQL query generated by CI: Code: SELECT * FROM "project_users" WHERE "userid" = 'user1' AND "password" = 'iamuser1' Note that the table names and table fields has double quotes, and that the reason of the issue: in a oracle SQL query, you DONT escape the name of the identifiers. Looking in the source of CI, de base class CI_DB has a flag indicating that identifiers MUST be escaped. This is not necessary in Oracle, so i just add this attribute in system/database/drivers/oci8_diver.php... Code: var $_protect_identifiers = FALSE; (If someone else want to test it, I put the line above before the method db_connect() on the OCI 8 Driver). (snip) Regards[/quote] |