<html><body>
<?php
$username = "wenchen";
$database = "wenchen";
$host = "undcemmysql.mysql.database.azure.com";
$password = "";
// Initializing MySQLi
$conn = mysqli_init( );
// Creating an SSL connection
mysqli_ssl_set( $conn, NULL, NULL, "DigiCertGlobalRootCA.crt.pem", NULL, NULL );
// Opening a new connection to the MySQL server
mysqli_real_connect( $conn, $host, $username, $password, $database, 3306 );
// Connecting to the database
if ( $conn->connect_errno )
die( 'Failed to connect to MySQL: ' . $conn->connect_error );
else
echo "Successfully connect to MySQL!";
// Closing the database connection
$conn->close( );
?>
</body></html>
|