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 ?

PHP MySQL functions mysql_fetch_length() : Length of Data MySQL Error

Subhendu Mohapatra — author at plus2net
Subhendu Mohapatra

Author

🎥 Join me live on YouTube

Passionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.



Subscribe to our YouTube Channel here



plus2net.com
tommi

16-03-2009

thanks, it works...




SQL Video Tutorials










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