Skip to content

Instantly share code, notes, and snippets.

@hamsterbacke23
Created August 14, 2014 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamsterbacke23/b31b26a086273c15456f to your computer and use it in GitHub Desktop.
Save hamsterbacke23/b31b26a086273c15456f to your computer and use it in GitHub Desktop.
check mysql server version
<?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