MySQLi connect 使用openssl連接 2017-08-20
$link = mysqli_init();
if (!$link)
die("資料庫ERROR!
");
mysqli_ssl_set($link , "ssl/client-key.pem" , "ssl/client-cert.pem" , "ssl/ca-cert.pem" , NULL , NULL);
if (!mysqli_real_connect($link , "db-ip" , "db-account" , "db-password" , "query"))
die("資料庫ERROR: " . mysqli_connect_error());
// Some queries...
mysqli_close($link);