Re: Can I check MYSQL version

From: Date: Sun, 08 Dec 2002 20:00:32 +0000
Subject: Re: Can I check MYSQL version
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-127448@lists.php.net to get a copy of this message
$sql = "SELECT VERSION()"; $result = mysql_query($sql); $ver = mysql_fetch_assoc($result); if($ver[0] >= 4) { echo "You have MySQL 4.0 or greater"; } else { echo "You DON'T have MySQL 4.0 or greater"; } Not sure if that'll work or not, I haven't tested it. Hope it does though. ----- Original Message ----- From: "John Taylor-Johnston" <taylorjo@collegesherbrooke.qc.ca> To: <php-general@lists.php.net> Sent: Sunday, December 08, 2002 2:57 PM Subject: Re: [PHP] Can I check MYSQL version > mysql> SELECT VERSION(); > -> '3.23.13-log' > > Ok, how do I PHP it for greater than or equals version 4 :? > > John > > Johannes Schlueter wrote: > > > On Sunday 08 December 2002 20:42, John Taylor-Johnston wrote: > > > Hi, > > > Can I check mysql version so if version >= 4 $sql = 'version 4 stuff' else > > > $sql ="version 3 stuff"; > > > > Try this SQL-Statement: > > > > SEELCT VERSION(); > > > > MySQL-Manual: > > http://www.mysql.com/doc/en/Miscellaneous_functions.html > > > > johannes > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#127448) next »