CI 3.0 and Microsoft SQL Server nightmare - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: CI 3.0 and Microsoft SQL Server nightmare (/showthread.php?tid=61938) |
CI 3.0 and Microsoft SQL Server nightmare - Mitteg - 06-01-2015 Hello, I have recently upgraded to CI 3.0 and now I cannot connecto to my SQL Server database like before. Here is my Config/database file: CODEIGNITER 2.X.X --> worked flawlessly Code: $active_group = 'default'; CODEIGNITER 3.0 -> error Code: $active_group = 'default'; Here is the error: Code: A Database Error Occurred I also tried a different driver. Here is the error I get if I use the sqlsrv driver: Code: A PHP Error was encountered Any ideas? This is driving me crazy. Thank you! RE: CI 3.0 and Microsoft SQL Server nightmare - Avenirer - 06-02-2015 Could you try this and tell me if it works? $db['default']['char_set'] = 'UTF-8'; RE: CI 3.0 and Microsoft SQL Server nightmare - gadelat - 06-02-2015 line 459 of sql_driver is a comment, so your installation is either corrupted or you are extending driver in some hackish, unofficial way RE: CI 3.0 and Microsoft SQL Server nightmare - ketav - 03-28-2016 I'm getting same error with Codeigniter 3. RE: CI 3.0 and Microsoft SQL Server nightmare - Narf - 03-29-2016 (06-02-2015, 06:15 AM)gadelat Wrote: line 459 of sql_driver is a comment, so your installation is either corrupted or you are extending driver in some hackish, unofficial way You're linking to 3.0.0, while the OP hasn't specified a micro-version number, so we have to assume the latest (i.e. 3.0.6), where 459 is the opening brace for the _limit() declaration. However, that error message still means that the stock CI files have been modified. RE: CI 3.0 and Microsoft SQL Server nightmare - aralena7 - 10-01-2016 Hi Mitteg How did you solve this error.. I have gone mad after this, still not able to correct this error , I used this setting in database.php $db['default']['hostname'] = 'localhost'; //$db['default']['hostname'] = '127.0.0.2'; $db['default']['port'] = 1433; $db['default']['username'] = 'sa'; $db['default']['password'] = ''; $db['default']['database'] = ''; //$db['default']['dbdriver'] = 'odbc'; $db['default']['dbdriver'] = 'sqlsrv'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = FALSE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; please help me, waiting..... RE: CI 3.0 and Microsoft SQL Server nightmare - InsiteFX - 10-03-2016 Here is the information for the newest ms sql driver for php it has php for stand alone testing of database. READ: Microsoft PHP Driver for SQL Server At least you can test it stand alone to make sure that your database is up and working. RE: CI 3.0 and Microsoft SQL Server nightmare - aralena7 - 10-03-2016 (10-03-2016, 04:10 AM)InsiteFX Wrote: Here is the information for the newest ms sql driver for php it has php for stand alone testing of database. InsiteFX thank you so much for replying. I am able to fix this error, Getting the login page but when I click on submit I get this error which is freaking me out: A PHP Error was encountered Severity: Warning Message: sqlsrv_query() expects parameter 1 to be resource, null given Filename: sqlsrv/sqlsrv_driver.php Line Number: 152 I have odbc server native client (odbc driver 13). I have spent a lot of time on this. It would be great if you could help me fix this error . Please RE: CI 3.0 and Microsoft SQL Server nightmare - InsiteFX - 10-04-2016 Parameter 1 should be your database connection id. You can try passing it into your query: Parameter 1: PHP Code: $this->db->conn_id; |