色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

PHP中如何測試MySQL數據庫鏈接

錢琪琛2年前10瀏覽0評論

ysqlinect()函數

<?phpame = "localhost";ame = "root";

$password = "password";ameyDB";

// 創建連接nysqlinectameameame);

// 檢測連接n) {nectionysqlinect_error());

}nected successfully";ysqlin);

?>

ysqlinectysqlinectnected successfully”。

二、使用PDO類

<?phpame = "localhost";ame = "root";

$password = "password";ameyDB";

try {newysqlameameameame, $password);

// 設置 PDO 錯誤模式為異常n->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);nected successfully"; $e) {nection failed: " . $e->getMessage();

}null;

?>

nected successfully”。