<?php
class database
{
public function info($type, $what = "")
{
// Get the first param $type, should be set to MYSQL or PHP.
switch ($type)
{
// Case is MYSQL load MYSQL information.
case "MYSQL":
$info = "<b>Version: </b>" . mysql_get_client_info() . "<br />\n" .
"<b>Host: </b>" . "<br />\n" .
"<b>Protocol: </b>" . "<br />\n" .
"<b>Server: </b>" . "<br />\n";
break;
// Case is PHP, load PHP information.
case "PHP":
// Look if the param $what is set to.
switch ($what)
{
// Nothing has been entered into the second param so default to empty.
case "":
$info = phpinfo(); // Display all PHP information.
break;
// Something is in the second param.
default:
$info = phpinfo($what); // Show a specific part of PHP info.
}
// End $what switch.
}
}
?>