ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  An Introduction to PEAR
Subject:   A little correction in the example
Date:   2001-06-23 04:01:09
From:   tvvcox
Hi Joao,


Very nice to see that article here in Onlamp and thanks also for the good critic on my Pear DB Tut. Just only few corrections in the example you give:


1) $dsn = array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'database' => 'test_db',
'username' => 'test_user',
'password' => 'test_password'
);


This is supported, but the "string" format is shortest and more recomended. So:
$dsn = 'mysql://test_user:test_pw@localhost/test_db';


2) simpleQuery is not in use right now, to launch the query simply use $dbh->query().


Regards,


Tomas V.V.Cox