Skip to content

Instantly share code, notes, and snippets.

@lefred
Last active May 28, 2021 11:54
Show Gist options
  • Save lefred/b97fe90f31115607e0d28ddc8a72ca16 to your computer and use it in GitHub Desktop.
Save lefred/b97fe90f31115607e0d28ddc8a72ca16 to your computer and use it in GitHub Desktop.
php example
<html>
<header>
<title>PHP on OCI with MySQL Database Service</title>
</header>
<body>
<center><h1>PHP on OCI with MySQL Database Service</h1></center>
<hr>
<?php
$user = "";
$pwd = "";
$mds = "";
$session = new mysqli($mds, $user, $pwd);
if ($con->connect_errno) {
echo ("Connection could not be established to MySQL");
}
else {
$result = $session->query('select @@version_comment as name, @@version as version');
$row = $result->fetch_row();
echo "<h3>You are connected successfully to <i>" . $row[0] . " " . $row[1] . "</i></h3>";
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment