Php version client version

PHP mysqli_get_client_version() Function

The mysqli_get_client_version() function returns the version number of the underlying MySQL client.

Syntax

mysqli_get_client_version($con);

Parameters

This is an object representing a connection to MySQL Server.

Return Values

PHP mysqli_get_client_version() function returns a integer value representing the version of underlying MySQL client library.

PHP Version

This function was first introduced in PHP Version 5 and works works in all the later versions.

Example

Following example demonstrates the usage of the mysqli_get_client_version() function (in procedural style) −

This will produce following result −

Client Library Version Number: 70405

Example

In object oriented style the syntax of this function is $con -> client_version. Following is the example of this function in object oriented style −

client_version; print("Client Library Version Number: ".$version); //Closing the connection $con -> close(); ?>

This will produce following result −

Client Library Version Number: 70405

Example

Now lets try invoking this function by passing the optional parameter (connection object) −

This will produce following result −

Client Library Version Number: 70405

Example

 print(mysqli_get_client_version($connection_mysql)); mysqli_close($connection_mysql); ?>

This will produce following result −

Источник

Php $version = Client::VERSION;

This tutorials show you how to use VERSION from Client.

VERSION from Client is used in the following way.

$version = Client::VERSION; Provides access to the connection pool.

The VERSION from Client is declared as follows:

class mysql_xdevapi\Client < /* Methods */ public close(): bool public getSession(): mysql_xdevapi\Session >

Examples

// w w w . d em o 2 s . co m /** * Copyright 2011 Bas de Nooijer. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this listof conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of the copyright holder. */ namespace Solarium\Tests; use Solarium\Client; class ClientTest extends \PHPUnit_Framework_TestCase < public function testVersion() < $version = Client::VERSION; $this->assertNotNull($version); > public function testCheckExact() < $this->assertTrue( Client::checkExact(Client::VERSION) ); > public function testCheckExactPartial() < $this->assertTrue( Client::checkExact(substr(Client::VERSION,0,1)) ); > public function testCheckExactLower() < $this->assertFalse( Client::checkExact('0.1') ); > public function testCheckExactHigher() < $this->assertFalse( Client::checkExact('99.0') ); > public function testCheckMinimal() < $this->assertTrue( Client::checkMinimal(Client::VERSION) ); > public function testCheckMinimalPartial() < $version = substr(Client::VERSION,0,1); $this->assertTrue( Client::checkMinimal($version) ); > public function testCheckMinimalLower() < $this->assertTrue( Client::checkMinimal('0.1.0') ); > public function testCheckMinimalHigher() < $this->assertFalse( Client::checkMinimal('99.0') ); > >

demo2s.com | Email: | Demo Source and Support. All rights reserved.

Источник

Get_client_version

In this article, we will focus on the mysqli_get_client_version() function in PHP, which is used to return the version number of the MySQL client library. We will provide you with an overview of the function, how it works, and examples of its use.

Introduction to the mysqli_get_client_version() function

The mysqli_get_client_version() function is a built-in function in PHP that is used to return the version number of the MySQL client library that is used by the MySQLi extension. This function is useful when you need to know the version number of the MySQL client library.

How to use the mysqli_get_client_version() function

Using the mysqli_get_client_version() function is very simple. You just need to call the function on a valid MySQLi connection. Here is an example:

 $mysqli = mysqli_connect("localhost", "username", "password", "database"); $client_version = mysqli_get_client_version($mysqli); printf("MySQL client library version number: %d\n", $client_version); mysqli_close($mysqli); ?>

In this example, we call the mysqli_connect() function to connect to a MySQL database with a username and password. We then call the mysqli_get_client_version() function on the MySQLi connection to get the version number of the MySQL client library. We then output the version number using the printf() function.

Conclusion

In conclusion, the mysqli_get_client_version() function is a useful tool for returning the version number of the MySQL client library. By understanding how to use the function, you can take advantage of this feature to create powerful and flexible MySQLi queries.

Источник

phpversion

Возвращает строку с номером версии текущего PHP-интерпретатора или модуля.

Список параметров

Необязательное имя модуля.

Возвращаемые значения

Возвращает текущую версию PHP в виде строки ( string ). Если в параметре extension указано строковое значение ( string ), phpversion() вернёт версию этого модуля или false , если информации о версии нет или модуль в данный момент не включён.

Список изменений

Примеры

Пример #1 Пример использования phpversion()

// Выводит строку типа ‘Текущая версия PHP: 4.1.1’
echo ‘Текущая версия PHP: ‘ . phpversion ();

// Выводит строку типа ‘2.0’ или ничего, если модуль не включён
echo phpversion ( ‘tidy’ );
?>

Пример #2 Пример использования PHP_VERSION_ID

// PHP_VERSION_ID доступна в версиях PHP 5.2.7 и выше. Если
// наша версия ниже, можно её сэмулировать
if (! defined ( ‘PHP_VERSION_ID’ )) $version = explode ( ‘.’ , PHP_VERSION );

define ( ‘PHP_VERSION_ID’ , ( $version [ 0 ] * 10000 + $version [ 1 ] * 100 + $version [ 2 ]));
>

// PHP_VERSION_ID определена как число. Чем больше число, тем новее
// PHP. Эта константа задаётся по той же схеме, что приведена выше:
//
// $version_id = $major_version * 10000 + $minor_version * 100 + $release_version;
//
// Теперь с PHP_VERSION_ID можно проверять, какая функциональность есть в
// текущей версии PHP. Не обязательно пользоваться version_compare()
// каждый раз, когда требуется проверить, поддерживает ли PHP нужную
// нам функцию.
//
// Например, мы можем задать значения констант PHP_VERSION_*,
// которые недоступны в версиях ранее 5.2.7

if ( PHP_VERSION_ID < 50207 ) define ( 'PHP_MAJOR_VERSION' , $version [ 0 ]);
define ( ‘PHP_MINOR_VERSION’ , $version [ 1 ]);
define ( ‘PHP_RELEASE_VERSION’ , $version [ 2 ]);

Примечания

Замечание:

Эта информация также доступна через предопределённую константу PHP_VERSION . Более детальную информацию можно получить с помощью констант PHP_VERSION_* .

Смотрите также

  • Константы PHP_VERSION
  • version_compare() — Сравнивает две «стандартизованные» строки с номером версии PHP
  • phpinfo() — Выводит информацию о текущей конфигурации PHP
  • phpcredits() — Выводит список разработчиков PHP
  • zend_version() — Получает версию движка Zend

Источник

PHP client_version / mysqli get_client_version() Function

The client_version / mysqli_get_client_version() function returns the MySQL client version as an integer.

The MySQL client version is returned in the following format: main_version*10000 + minor_version*100 + sub_version. So, version 6.3.0 is returned as 60300.

Syntax

Object oriented style:

Procedural style:

Parameter Values

Technical Details

Unlock Full Access 50% off

COLOR PICKER

colorpicker

Join our Bootcamp!

Report Error

If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:

Thank You For Helping Us!

Your message has been sent to W3Schools.

Top Tutorials
Top References
Top Examples
Get Certified

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Источник

Читайте также:  Required request body is missing public java lang string
Оцените статью