im trying to connect to a database on odbc with php and i get the error of
Fatal error: Uncaught PDOException: could not find driver in C:\xampp\htdocs\testarsybase\index.php:3 Stack trace: #0 C:\xampp\htdocs\testarsybase\index.php(3): PDO->__construct('odbc:host=192.1...', 'sa', '') #1 {main} thrown in C:\xampp\htdocs\testarsybase\index.php on line 3
im using the PDO('odbc (..)') to connect
What should i do?
See if this situation helps you. It seems to be the same question.
PDO returning error “could not find driver” with a known working DSN
Related
When ever I try to enter data or connect to the database, I get this error
Fatal error: Uncaught Error: Call to undefined function
mysql_pconnect() in C:\xampp\htdocs\smstrail\admin\lib\dbcon.php:8
Stack trace: #0 C:\xampp\htdocs\smstrail\header.php(2): dbcon() #1
C:\xampp\htdocs\smstrail\index.php(2): include('C:\xampp\htdocs...')
2 {main} thrown in C:\xampp\htdocs\smstrail\admin\lib\dbcon.php on line 8
Example of line 8:
#mysql_pconnect($host,$user,$pass);
The function mysql_pconnect is deprecated in PHP 5.5.0. You should either use
mysqli_connect or make a connection using PDO. Check out the documentation for more info : http://php.net/manual/en/function.mysql-pconnect.php
I'm using odbc and XAMPP. I'm receiving the fatal error of could not find driver
Fatal error: Uncaught PDOException: could not find driver in C:\xampp\htdocs\index.php:5 Stack trace: #0 C:\xampp\htdocs\index.php(5): PDO->__construct('odbc:BEGIN') #1 {main} thrown in C:\xampp\htdocs\index.php on line 5
This is the code the error refering to :
$conn = new PDO ("odbc:BEGIN");
Is there any module that I should add to the php.ini like this answer or there are other solution?
You need to enable those extensions in order to have ODBC PDO driver working
php_pdo.dll
php_odbc.dll
php_pdo_odbc.dll
After enabling those extension as #Sarhan said, we need to restart Apache in order for it to work.
I'm trying to connect to a Foxpro database using the OLE DB Driver
I downloaded the driver from http://www.microsoft.com/en-us/download/details.aspx?id=14839 and installed it then create a php script
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
$conn->Open("Provider=vfpoledb.1;Data Source=C:\Opera3\Comp_I.DBC;Collating Sequence=machine");
This gives me the following error
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> ADODB.Connection<br/><b>Description:</b> Provider cannot be found. It may not be properly installed.' in C:\inetpub\wwwroot\test1.php:4 Stack trace: #0 C:\inetpub\wwwroot\test1.php(4): com->Open('Provider=vfpole...') #1 {main} thrown in C:\inetpub\wwwroot\test1.php on line 4
Any help in getting this working would be much appreciated.
As requested
uninstalled and reinstalled from command line as administrator for all users and now it works –
i have big problem while connection to a remote informix database server.
here's the code
$db = new PDO("informix:host=192.168.*.*; service=1565;
database=daten; server=name; protocol=onsoctcp;
EnableScrollableCursors=1", "informix", "info00");
print "Connection Established!\n\n";
echo "Table contents: $rows.\n";
I receive the following error:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE=HY000, SQLDriverConnect: -917 [Informix][Informix ODBC Driver][Informix]Must close current database before using a new database.' in /var/www/informix.php:9 Stack trace: #0 /var/www/informix.php(9): PDO->__construct('informix:host=1...', 'informix', 'info00') #1 {main} thrown in /var/www/informix.php on line 9
How can I fix this?
I think you should also set the DB_LOCALE environment variable.
When the client application requests a connection, it sends information, including the DB_LOCALE to the database server.
I have installed PDO_INFORMIX and CSDK already on CentOS5.6 32bits
and index.php have
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
$db = new PDO("informix:host=172.30.179.81; service=5000;database=cms; EnableScrollableCursors=1", "myuser", "mypassword");
print("OK");
?>
but i still got this error
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE=HY000, SQLDriverConnect: -11060 [Informix][Informix ODBC Driver]General error.' in /usr/local/apache/htdocs/index3.php:5 Stack trace: #0 /usr/local/apache/htdocs/index3.php(5): PDO->__construct('informix:host=1...', 'myuser', 'mypassword') #1 {main} thrown in /usr/local/apache/htdocs/index3.php on line 5
Have anyone know what it is ?
Thanks
Ouch! The standard technique for finding out more about errors is:
$ finderr -11060
-11060 General error.
An error occurred that has no specific SQL_STATE. In this case,
additional text is provided that identifies the source of the problem.
This IBM Informix CLI error code is the same as SQLSTATE value S1000.
$
That is not very helpful - to be polite about it.
There are spaces in the connect string; does removing them help at all?
Can you telnet to the host 172.30.179.81?
Can you telnet to the port (service) 5000 on the host?
Can you connect from this machine using any other Informix tool?
Can you connect from other machines using the same connect string?
In case of desparation, can you track down whether all the shared libraries are loading correctly?