<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Altmint Blog &#187; mysql vesion</title>
	<atom:link href="http://blog.altmint.com/tag/mysql-vesion/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.altmint.com</link>
	<description></description>
	<lastBuildDate>Mon, 24 Oct 2011 09:11:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to know Mysql Version Using PHP</title>
		<link>http://blog.altmint.com/how-to-know-mysql-version-using-php</link>
		<comments>http://blog.altmint.com/how-to-know-mysql-version-using-php#comments</comments>
		<pubDate>Thu, 08 Apr 2010 07:11:58 +0000</pubDate>
		<dc:creator>Kongoti</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[know mysql version using php]]></category>
		<category><![CDATA[mysql vesion]]></category>

		<guid isPermaLink="false">http://blog.altmint.com/?p=86</guid>
		<description><![CDATA[How to know Mysql Version Using PHP ?. We can know the mysql version in the phpinfo. But if we want to display the mysql version in any web page dynamically, how we are you going to deal with that ?. A little bit logic and a liitle bit manipulation on the phpinfo information we <a href="http://blog.altmint.com/how-to-know-mysql-version-using-php">Continue Reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><strong>How to know Mysql Version Using PHP ?.</strong></p>
<p>We can know the mysql version in the phpinfo. But if we want to display the mysql version in any web page dynamically, how we are you going to deal with that ?.</p>
<p>A little bit logic and a liitle bit manipulation on the phpinfo information we can achieve that.</p>
<p>Create a file like this and name it as phpinfo.php</p>
<pre class="brush: php">
&lt;?php
phpinfo();
?&gt;
</pre>
<p>Create another file mysql_version.php with the following code</p>
<pre class="brush: php">
&lt;?php
$file = @file_get_contents(&quot;http://DOMAINNAME/phpinfo.php&quot;);
$start = explode(&quot;&lt;h2&gt;&lt;a name=\&quot;module_mysql\&quot;&gt;mysql&lt;/a&gt;&lt;/h2&gt;&quot;,$file,1000);
if(count($start) &lt; 2){
echo &quot;MySQL is not on this server.&quot;;
}else{
$again = explode(&quot;&lt;tr&gt;&lt;td class=\&quot;e\&quot;&gt;Client API version &lt;/td&gt;&lt;td class=\&quot;v\&quot;&gt;&quot;,$start[1],1000);
$last_time = explode(&quot; &lt;/td&gt;&lt;/tr&gt;&quot;,$again[1],1000);
echo &quot;MySQL Version: &lt;b&gt;&quot;.$last_time[0].&quot;&lt;/b&gt;&quot;;
}
?&gt;
</pre>
<p>replace &#8220;DOMAINNAME&#8221; with your domain name.</p>
<p>This is one of the solution.</p>
<p>You can also know the mysql version if you are using a linuxÂ  server and you have the permission to execute the shell commands, the following code will work.</p>
<pre class="brush: php">
&lt;?php
function find_SQL_Version() {
$output = shell_exec(&#039;mysql -V&#039;);
preg_match(&#039;@[0-9]+\.[0-9]+\.[0-9]+@&#039;, $output, $version);
return $version[0];
}
echo &#039;Your SQL version is &#039; . find_SQL_Version();
?&gt;
</pre>
<p>If any one know other than these methods please feel free to share with us.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.altmint.com/how-to-know-mysql-version-using-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

