paul lanken
paul lanken

Reputation: 197

What is the most up to date production version of mysqli ?

Tough to figure out if I have an up to date version of mysqli or not. I use this in a web page :

$link = mysqli_connect($hostname, $username, $password, $dbname);
printf("MYSQLi Client library version: %s<br>\n", mysqli_get_client_info());

The output is :

MYSQLi Client library version: mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $

Well that is all well and nice .. but my MySQL rev is 5.5.30 base on this :

//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
  or die("Unable to connect to MySQL");
echo "Connected to ";
// print the MySQL server version
printf("MySQL server version: %s<br>\n", mysql_get_server_info());

Which results in :

Connected to MySQL server version: 5.5.30

Should I expect to see a mysqli rev of 5.5.x or am I wrong?

Any insight would be helpful.

This is Apache 2.4.4 and PHP 5.4.12 if that helps :

$ /usr/local/bin/php --version 
PHP 5.4.12 (cli) (built: Feb 25 2013 19:25:44) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

$ /usr/local/bin/httpd -v
Server version: Apache/2.4.4 (Unix)
Server built:   Feb 28 2013 10:46:58

Upvotes: 0

Views: 795

Answers (1)

Th. Ma.
Th. Ma.

Reputation: 9464

The mysqli extension has been built using a MySQL distribution which version was different from your (MySQL) server version:

http://php.net/manual/en/mysqli.installation.php

You'll notice the output refers to MYSQLi Client library version.

To obtain the version of your server distribution, you can execute the following query using the same PHP version of PHP and mysqli extension: SELECT @@version;

$mysqli = new mysqli('host', 'username', 'my_secret_password...');
$result = $mysqli->query('SELECT @@version;');

print_r($result->fetch_array());

Upvotes: 1

Related Questions