FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » php PDO does not work
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: php PDO does not work [message #177282 is a reply to message #177281] Sat, 03 March 2012 15:34 Go to previous messageGo to previous message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma:
Senior Member
On 03-03-2012 16:10, test japan wrote:
> i installed php and mysql on archlinux 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) {

change above line to:
} catch (PDOException $ex) {


> echo $ex->getMessage();
>
>
> anyone can help me?
> thanks!
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stats comp.lang.php (last 7 days)
Next Topic: Mac OS X how to install php / yaml ?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 17:49:56 GMT 2024

Total time taken to generate the page: 0.04778 seconds