You are not logged in.

#1 2012-03-03 14:10:39

testAtJapan
Member
Registered: 2012-03-03
Posts: 2

[SOLVED] php PDO does not work

i installed php and mysql by pacman,
and in phpinfo page, i can see the infomation about mysql & pdo_mysql

in php.ini, i uncommented the following lines:
extension=mysqli.so
extension=mysql.so
extension=pdo_mysql.so

but when running the code below, the browser shows a blank page
no result, even no error message.

    try {
        $dbh = new PDO("mysql:host=192.168.0.1;dbname=testdb", "username", "password");
        echo 'Connected to database!!';
    } catch (PDOException ex) {
        echo $ex->getMessage();
   

anyone can help me?
thanks!

Last edited by testAtJapan (2012-03-04 01:16:23)

Offline

#2 2012-03-04 01:16:01

testAtJapan
Member
Registered: 2012-03-03
Posts: 2

Re: [SOLVED] php PDO does not work

solved this problem by the other forum's guys.

i misspell the
PDOException ex
it should be
PDOException $ex

and modified the php.ini like below, the page will show the error Messages.
error_reporting = E_ALL
display_errors = On

Offline

Board footer

Powered by FluxBB