Skip to content

Instantly share code, notes, and snippets.

@j0k3r
Forked from pborreli/mysqlinfo.php
Created September 23, 2010 19:11
Show Gist options
  • Save j0k3r/594166 to your computer and use it in GitHub Desktop.
Save j0k3r/594166 to your computer and use it in GitHub Desktop.
mysqlinfo - A phpinfo() like for mysql
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
a { text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-family: arial, helvetica, sans-serif; font-size: 18pt; font-weight: bold;}
h2 { font-family: arial, helvetica, sans-serif; font-size: 14pt; font-weight: bold;}
body, td { font-family: arial, helvetica, sans-serif; font-size: 10pt; }
th { font-family: arial, helvetica, sans-serif; font-size: 11pt; font-weight: bold; }
</style>
<title>mysqlinfo()</title>
</head>
<body>
<?php
mysql_connect("localhost","root","");
$query = mysql_query("show variables");
?>
<br>
<table cellpadding="3" cellspacing="0" width="600" align="center" style="border-collapse: collapse;border: 1px solid #000000">";
<tr bgcolor="#9999cc">
<td>
<b><font style="font-size: 20px">MySQL Version <?php echo mysql_get_server_info() ?></font></b>
</td>
<td align="right"><a href="http://mysql.com" target="_blank"><img src="http://mysql.com/common/logos/logo-mysql-110x57.png" border="0"></a></td>
</tr>
</table>
<br>
<table cellpadding="3" cellspacing="0" width="600" align="center" bgcolor="ccc8fa" style="border-collapse: collapse; border: 1px solid #000000">
<?php
while ($row=mysql_fetch_array($query))
{
echo "<tr><td style=\"border: 1px solid #000000\" bgcolor=#ccccff><b>";
echo $row[0];
echo "</b></td><td style=\"border: 1px solid #000000\" bgcolor=#cccccc>";
echo $row[1];
echo "</td></tr>";
}
?>
</table>
<br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment