Page 1 of 1

determine mysql version from php...

Posted: Sat Feb 18, 2006 6:08 pm
by Burrito
how can I do this?

I know I could run exec('mysql -h localhost -V'); but I want something a little more elegant....

Posted: Sat Feb 18, 2006 6:16 pm
by SKDevelopment
I do not know how elegant it is, but I am doing it like this:

Code: Select all

$r = mysql_query("SELECT VERSION()") or die(mysql_error());
$a = mysql_fetch_row($r);
As a result you get something like $a[0] = "5.0.18-nt".

--
Best Regards,
Sergey Korolev
www.SKDevelopment.com

Posted: Sat Feb 18, 2006 6:17 pm
by Burrito
perfect, thank you.