Can't select MSSQL table - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Can't select MSSQL table (/showthread.php?tid=72364) |
Can't select MSSQL table - wuk986 - 12-10-2018 I am connected to a MSSQL Server (10.50.2550.0) and I want to select a table from a database where I have read permission. The database configuration looks like this: Code: $db['lardis_mssql'] = array( The connection is successfull and the database has the following tables:
Code: $query = $this->db->get('Events'); The result looks like this: Quote:A Database Error Occurred When I leave "database" in the database.php empty, I get the same result. Therefore I think there is an misconfiguration at the sql server. could this be possible or where could be the error? Thanks in advance PS: In the SQL Server Management Studio the standard database of my user is "LardisLog" and the sorting is "Latin1_General_CI_AS" RE: Can't select MSSQL table - InsiteFX - 12-11-2018 Did you install Microsoft Drivers for PHP for SQL Server on windows? Microsoft Drivers for PHP for SQL Server 7 Steps to make SQL Server and Codeigniter Works RE: Can't select MSSQL table - wuk986 - 12-11-2018 (12-11-2018, 09:28 AM)InsiteFX Wrote: Did you install Microsoft Drivers for PHP for SQL Server on windows? Yes, the driver are installed and working. The connection to the SQL Server is established, but it seem that I can't find any table in the database. On the SQL-Server I should have only read permission as db_datareader and when I check the schema db_datareader there is no permission specified I think I have a talk with the admin RE: Can't select MSSQL table - InsiteFX - 12-11-2018 You may also need the Microsoft ODBC drivers installed. RE: Can't select MSSQL table - wuk986 - 12-15-2018 (12-11-2018, 12:53 PM)InsiteFX Wrote: You may also need the Microsoft ODBC drivers installed. I have installed the ODBC driver as you recommended but without success As i wrote the connection is successfull, but i can not find the existing table in the database. Quote:A Database Error Occurred My thoughts are, that there is an misconfiguration on the sql server, and it might be possible that the admin of the SQL server is not familiar with the server as he schould be Thanks in advance RE: Can't select MSSQL table - InsiteFX - 12-15-2018 PHP.net SQLSRV - Requirements How to SQL Server Database Connection (MSSQL) in Codeigniter 3 You may need to add the port number also. If these do not work check your php installation using php PHP Code: <?php DO NOT LEAVE ON A SERVER! DELETE IT WHEN DONE. RE: Can't select MSSQL table - wuk986 - 12-15-2018 (12-15-2018, 09:51 AM)InsiteFX Wrote: PHP.net SQLSRV - Requirements Big thanks for you support! Everything, including the port on the client side, is set to "1433". But I do not know if the port is set correctly on the SQL server. The link "how to SQL Server Database Connection (MSSQL) in Codeigniter 3" I have forwarded to the SQL-Serveradmin. remark sqlcmd will show me the selected table. Kind regards RE: Can't select MSSQL table - wuk986 - 12-18-2018 Thanks for all your support. The config of the database and codeigniter is correct and the error was, that I have a primary database (SQLite) and the second MSSQL Database and I always tried to connect to the SQLite database. PHP Code: public function __construct() RE: Can't select MSSQL table - oliverfinn556 - 12-24-2018 This has also happened to me, so i never try to use different databases |