PHP連接資料庫
chijung
發表於 2020/12/03_10:41
$connect = mysqli_connect("localhost", "使用者名稱", "密碼");
if (mysqli_connect_errno($connect)) { echo "連線失敗"; }
else{
echo "連線成功";
mysqli_query( $connect, "SET NAMES 'UTF8'");
mysqli_select_db( $connect, "資料庫名稱" );
}
留言回應