CI 3.0 and Microsoft SQL Server nightmare |
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!
Could you try this and tell me if it works?
$db['default']['char_set'] = 'UTF-8'; Website: http://avenir.ro
line 459 of sql_driver is a comment, so your installation is either corrupted or you are extending driver in some hackish, unofficial way
(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.
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.....
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. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(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
Parameter 1 should be your database connection id.
You can try passing it into your query: Parameter 1: PHP Code: $this->db->conn_id; What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |