/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// connect DB 'phptype' => 'mysql', 'username' => '---username---', 'password' => '---password---', 'hostspec' => '---host---', 'database' => '---db name---' ); 'portability' => MDB2_PORTABILITY_ALL ); function errorHandler($error){ } PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errorHandler'); $mdb2 =& MDB2::connect($dsn, $options); $sql = 'set names utf8'; $res =& $mdb2->query($sql); $mdb2->setFetchMode(MDB2_FETCHMODE_ASSOC);
Comments
