本文整理匯總了PHP中BD::bd方法的典型用法代碼示例。如果您正苦於以下問題:PHP BD::bd方法的具體用法?PHP BD::bd怎麽用?PHP BD::bd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BD
的用法示例。
在下文中一共展示了BD::bd方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
private function __construct()
{
try {
self::$bd = new PDO('mysql:host=localhost;dbname=contabilidad', 'root', '');
self::$bd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo "Connection Error: " . $e->getMessage();
}
}
示例2: __construct
private function __construct()
{
try {
self::$bd = new PDO('mysql:host=mysql.hostinger.es;dbname=u174001298_hard', 'u174001298_root', 'secret');
self::$bd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo "Connection Error: " . $e->getMessage();
}
}
示例3: __construct
private function __construct()
{
try {
self::$bd = new PDO("mysql:host={$this->equipo};dbname={$this->basedatos}", $this->usuario, $this->contrasenya);
} catch (PDOException $e) {
echo "Connection Error: " . $e->getMessage();
die;
}
}
示例4: __construct
private function __construct()
{
try {
self::$bd = new PDO('mysql:host=localhost;dbname=vinilajax;charset=utf8', 'root', '');
self::$bd->exec("set names utf8");
self::$bd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo "Connection Error: " . $e->getMessage();
}
}
示例5: __construct
private function __construct()
{
try {
self::$bd = new PDO('mysql:host=fdb6.atspace.me;dbname=2063414_vinil;charset=utf8', '2063414_vinil', 'entrar08');
self::$bd->exec("set names utf8");
self::$bd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo "Connection Error: " . $e->getMessage();
}
}