Reputation: 690
I can use:
extension_loaded('mysql')
to check if mySQL is installed on the server or not.
also phpinfo() can display a nice phpinfo page.
but how to get which mysql version is installed on server? is there any function like:
which_extension_version('mysql') //output the mysql version?
just like the PHP_VERSION?
Upvotes: 0
Views: 1112
Reputation: 12042
Use the mysql_get_server_info()
after connect with mysql_connect
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
printf("MySQL server version: %s\n", mysql_get_server_info());
?>
Upvotes: 1