| Subject: | And what about an create instance... |
| Summary: | Package rating comment |
| Messages: | 1 |
| Author: | Jean-Christophe |
| Date: | 2011-12-31 21:20:15 |
| |
|
|
Jean-Christophe rated this package as follows:
| Utility: | Good |
| Consistency: | Sufficient |
|
|
 Jean-Christophe - 2011-12-31 21:20:16
And what about an create instance function like approximately this:
public static function getInstance(){
if (!self::$instance)
{
self::$instance = new PDO("mysql:host=$host;dbname=$dbname", 'root', 'PASSXXX');
self::$instance-> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
self::$instance-> query("SET NAMES utf8");
}
return self::$instance;
}
And the special PDO insert or Update called: REPLACE INTO... can be util to !
|