Skip to content

Instantly share code, notes, and snippets.

@tiagones
Created May 4, 2016 19:15
Show Gist options
  • Save tiagones/bf750753259033d0c3350591f8230c29 to your computer and use it in GitHub Desktop.
Save tiagones/bf750753259033d0c3350591f8230c29 to your computer and use it in GitHub Desktop.
<?php
##Test What Exact Version PHP & MySQL
echo "<h2>Exact Version PHP & MySQL: </h2>";
printf("PHP version: %s\n", PHP_VERSION);
$mysql = mysqli_connect('localhost', 'root', '');
## Test the MySQL connection
if (mysqli_connect_errno()) {
printf("</br> Connection failed: %s\n", mysqli_connect_error());
exit();
}
## Print the MySQL server version
printf("</br> MySQL server version: %s\n", mysqli_get_server_info($mysql));
##Close the MySQL connection
mysqli_close($mysql);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment