Internet Marketing Forum

Internet Marketing Forum


For Webmasters and Entrepreneurs
GoDaddy.com Hosting just $1.99/mo! - 468x60
|
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 22, 2012, 07:06:01 PM

Login with username, password and session length

If opportunity doesn't knock, build a door.


- Milton Berle

|-   Internet Marketing Forum > Online Business Discussions > Website Design and Maintenance > Programming
+  

How to get MySQL Version in PHP ?

0 Members and 1 Guest are viewing this topic.
Pages: [1] Reply to Thread
Author Topic: How to get MySQL Version in PHP ?  (Read 411 times)
OfflineRichKid
Pro Member
RichKid is on a distinguished road
Joined: Jan 2007
Posts: 559


Avatar of RichKid

View RichKid\s ProfileWWW
Gender: MalePisces Brazil
notepad Sep 27, 2011, 05:07:25 PM #1
Can't seem to find a clear answer to this without executing a shell command but how do you get the MySQL version in PHP ?

OfflineAceCoder
Junior Member
AceCoder is on a distinguished road
Joined: Oct 2007
Posts: 79



View AceCoder\s ProfileWWW
United States
notepad Sep 27, 2011, 06:51:27 PM #2
There is no way to do it natively in PHP without connecting to the MySql server but if your script is connected to MySql, you can do the following


Code:
$result = mysql_query("select version() as mysqlversion");
$rs = mysql_fetch_object( $result );
$mysqlversion = $rs->mysqlversion;

Latest Blog Post : PHP – Pass by Reference or Pass by Value

728x90 Take the First Step
Pages: [1] Reply to Thread


Code4Gold Internet Marketing Forum © 2006-2011 Resdaz Media LLC - All Rights Reserved
Forum Software Powered by SMF - © 2001-2008, Lewis Media. All Rights Reserved.