Displaying MySQL Version running

If you are using phpmyadmin then go to the home page and at the top you will get the version of phpmyadmin along with mysql version number.

We can easily get the version of MySQL running by using php code. This script assumes that you already established MySQL connection and it is working fine.

We will use one select query command to get the data from running mysql database. Here is the code.

<?Php
////////////////
require "config.php"; // Database Connection
////////////////
include "menu.php";
$result = $dbo->query("SHOW VARIABLES LIKE '%version%'");
$i=1;
echo "<table class='t1'><tr>";
while ($row = $result->fetch(PDO::FETCH_NUM)) {
$m=$i%2;

echo "<tr class='r$m'><td>$row[0]</td><td>$row[1]</td></tr>";
$i=$i+1;
}
echo "</table>";
?>

This script is used in our MySQL admin script.

How to get PHP Version ?


plus2net.com



tommi

16-03-2009

thanks, it works...

Post your comments , suggestion , error , requirements etc here .





SQL Video Tutorials










We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer