Simple Machines Community Forum

General Community => Scripting Help => Topic started by: Spaceman-Spiff on August 16, 2003, 01:51:53 PM

Title: Obtain MySQL version info
Post by: Spaceman-Spiff on August 16, 2003, 01:51:53 PM
I'm just wondering if its possible to get mysql version using php, like the one shown in phpinfo
i think this could be useful when i need to use specific queries that are only available in certain versions of mysql
Title: Re:Obtain MySQL version info
Post by: Michele on August 16, 2003, 04:10:56 PM
Take a look in install.php for function mysql_version_check($reqver) . 8)
Title: Re:Obtain MySQL version info
Post by: Spaceman-Spiff on August 16, 2003, 04:33:07 PM
thanks

the function i'm looking for is mysql_get_client_info (http://www.php.net/manual/en/function.mysql-get-client-info.php) and mysql_get_server_info() (http://ca.php.net/manual/en/function.mysql-get-server-info.php)
cant tell the difference between them though
i guess i'll just have to use both
Title: Re:Obtain MySQL version info
Post by: [Unknown] on August 16, 2003, 05:45:08 PM
*holds up hand*

Wait, wait... important difference here!!!

The *client* is PHP.  This information usually is... useless.  The server is the one you want.

-[Unknown]
Title: Re:Obtain MySQL version info
Post by: Spaceman-Spiff on August 16, 2003, 06:06:45 PM
errr install.php uses mysql_get_client_info and php manual says: mysql_get_client_info() returns a string that represents the client library version.
Title: Re:Obtain MySQL version info
Post by: [Unknown] on August 16, 2003, 06:09:04 PM
$curver = mysql_get_server_info() < mysql_get_client_info() ? mysql_get_server_info() : mysql_get_client_info();

Uses both.

-[Unknown]
Title: Re:Obtain MySQL version info
Post by: Shoeb Omar on August 16, 2003, 06:21:55 PM
lmao the fix all solution.  I'm assuming it returns in tthen.