Created
August 14, 2014 15:08
-
-
Save hamsterbacke23/b31b26a086273c15456f to your computer and use it in GitHub Desktop.
check mysql server version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$link = mysql_connect("host", "db", "pw"); | |
if (!$link) die('Could not connect: ' . mysql_error()); | |
$sql = 'SHOW VARIABLES LIKE "%version%"'; | |
$result = mysql_query($sql,$link); | |
print "MySQL server version: " . mysql_get_server_info(); | |
while($row = mysql_fetch_assoc($result)){ | |
foreach($row as $cname => $cvalue){ | |
print "$cname: $cvalue\t"; | |
} | |
print "\r\n"; | |
} | |
mysql_close($link); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment