I have a project working with CodeIgniter and sqlserver 2008 I updated my pc to windows 10 then stopped working, the sqlserver driver for php is configured and my php ini shows it, also the code connects to sql server but now when im triying to do a query it givme false
so this code:
$this->db->select('*')->from('distritos')->get()->result();
Fatal error: Call to a member function result() on a non-object in C:\
Always its like sqlserver not working anymore but cannot fix it.
Php info shows
PDO
PDO support enabled
PDO drivers mysql, pgsql, sqlite, sqlsrv
pdo_sqlsrv
pdo_sqlsrv support enabled
Version 3.0.2.2R (Unofficial)
Unofficial Changes Works with Native Clients 11/10/9
sqlsrv
sqlsrv support enabled
Version 3.0.2.2R (Unofficial)
Unofficial Changes Works with Native Clients 11/10/9
EDIT:
its my mistake cannot conect
Unable to connect to your database server using the provided settings.
Filename: C:/www/***/system/database/DB_driver.php
Line Number: 436
the database config its okay :S
The error wasnt on the config, was on the password that was expired but the code igniter wasn't showing the error becouse i have to active this config :
database.php
'db_debug' => TRUE,
Solved ;)
Related
I am trying to connect to a Firebird database using PHP.
This is the simple code that I use to connect to it.
$user = "******";
$password = "******";
$ODBCConnection = odbc_connect("DRIVER={Firebird/InterBase(r) driver};Database=******;Server=******;Port=******", $user, $password);
I have installed the ODBC driver for Firebird from this webpage https://www.firebirdsql.org/en/odbc-driver/. I've managed to add the correct (I believe) string to the DRIVER inside the ODBC Conection, but now I encounter this error:
Warning: odbc_connect(): SQL error: [ODBC Firebird Driver]Unable to connect to data source: library 'gds32.dll' failed to load, SQL state 08004 in SQLConnect
I am running an Apache server using XAMPP on localhost. Everything I wrote is in the index.php file, just trying to connect to the database.
Any help would be greatly appreciated.
This error occurs when you do not have the Firebird client library (fbclient.dll, or gds32.dll which is tried as a fallback) installed on your system (or you have it installed, but it has the wrong bitness).
To install the Firebird client library, use a Firebird server installer of the right bitness* (eg Firebird 3 Windows 64-bit from https://www.firebirdsql.org/en/firebird-3-0/), and install the Client components.
That said, if you're using PHP, it might make sense to use the Firebird PHP driver instead (though this will still need fbclient.dll to be installed).
*: right bitness: If you use a 32-bit PHP, you need the 32-bit client library, if 64-bit, then the 64-bit client library.
I am trying to connect php with interbase. It seems php only works with firebird, instead of interbase. I already have a database , that is created in interbase, I just need connectivity with interbase, not firebird. When I am trying to connect it with interbase, it says .. invalid database. where as connection with firebird database is working fine. Using php 5.6, windows server, 64 bit architechture
There's a ton of helpful comments at the ibase_connect function page over at php.net, are you sure that you're following through and checking version numbers? It appears that you may need to perform a manual fix and set the dialect version of the connection, as follows:
ibase_connect ('localhost:/usr/db/db.gdb', 'SYSDBA', 'masterkey', 'ISO8859_1', '100', '1' ) ;
The last 1 as a parameter resets the dialect mode between the ibase_connect() and Interbase. You also should check and see if the version of PHP you're running is compatible with the version of Interbase you're running.
I have a PHP website using SQL Server as the database. I want to put it on the windows server. The server using IIS 7. I have a problem to run my website, when I try to login I always get an error :
PDOException in Connector.php line 55:
could not find driver
I did put the pdo sql driver in my php ext. and I already registered that in php.ini but I still got that error.
And in my phpinfo() I could not find the "sqlsrv" words at all. Do you know why and how to fix this?
If you are using IIS for PHP, you should load dlls with nts (non-thread safe) version.
php_sqlsrv_56_nts.dll
php_pdo_sqlsrv_56_nts.dll
I cannot access the ODBC Driver. I have a 64 bit Windows 7 System. To connect to a ODBC 5.1 Driver I used C:\Windows\SysWOW64\odbcad32. I created a User DSN with name AJOY. There was no problem with that. Everything worked fine for the past 3 months. But now when I use
odbc_connect()
to connect with the same User DSN name i have a problem. I usually connect by the statement
$conn=odbc_connect("Ajoy","","");
There was no problem with the statement earlier. But now When I run my code it returns like
odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect
When I check the Data Sources (ODBC) in control panel, I can see the User DSN that I created but I cannot remove it. When i click remove it throws an error like
The setup routines for the MySQL 5.1 Driver ODBC could not be found. Please re-install the driver
It also returns there is an architecture mismatch between the driver and the application. I tried various steps but still it is not working. How to fix this? Help me please!!
I believe your problem is what odbcad32 you are using. You must use the one in the c:\Windows\System32 for a 64 bit application; not the c:\windows\SysWow64 directory.
There are 2 versions, one for 32 bit and one for 64 bit applications.
I inherited an old Cakephp site that was using adodb as a driver to connect to an MSSQL database and it turns out this is no longer supported in the new version of cake (1.3, we are in 1.2) so I'm trying to change the driver so I can upgrade. We're using IIS and a sql server 2005 database on a different server, php 5.2.17. However using driver "mssql" gives me the following errors:
PHP SQL Server interface is not installed. For troubleshooting information, see http://php.net/mssql/
Call to undefined function mssql_min_message_severity()
The top error leads me to a page regarding the old php_mssql.dll, which according to this question: ( CakePHP: error when trying to use mssql datasource ) will become a problem when I switch to PHP 5.3 so I'm trying to use the php_sqlsrv*.dll for my php version but I still get the error. Could never get the mssql.dll one to work either. I do however see "sqlsrv support enable" in phpinfo.php and the whole sqlsrv section is intact there.
In cake php I'm using "driver => 'mssql'", is this the correct driver for the new sqlsrv dll? Is there something I'm missing? For kicks I tried 'driver' => 'sqlsrv', that fixes the php SQL Server interface error but I still get
"Fatal error: Call to undefined function sqlsrv_min_message_severity() in C:\Inetpub\wwwroot\riverstone-dev\www\cake\libs\model\datasources\dbo\dbo_sqlsrv.php on line 107"
Installing the latest SQL Native Client set from Microsoft and reenabling the extension in PHP has worked, albeit on a different server. Please try the drivers below if having a similar problem:
http://www.microsoft.com/download/en/details.aspx?id=20098