Showing entries 21 to 26
« 10 Newer Entries
Displaying posts with tag: mysqlnd (reset)
Demonstrating the Features of MySQL Native Driver for PHP, mysqlnd

Support for Persistent Connections

ext/mysqli does not support persistent connections when built with libmysql. However ext/mysqli does support persistent connections when built with mysqlnd. To establish a persistent connection with the MySQL server using ext/mysqli and mysqlnd, prepend the database host with the string "p:" (p stands for persistent) as shown below.


$host="p:localhost";
$port=3306;
$socket="/tmp/mysql.sock";
$user="root";
$password="admin";
$dbname="test";

$cxn = new mysqli($host, $user, $password, $dbname, $port, $socket)
        or die ('Could not connect to the database server' . mysqli_connect_error());

ext/mysql, ext/mysqli and PDO_MySQL support persistent connections when built with mysqlnd.

The new API call mysqli_fetch_all()

mysqlnd extends the ext/mysqli API with one brand new method, …

[Read more]
Demonstrating the Features of MySQL Native Driver for PHP, mysqlnd

Support for Persistent Connections

ext/mysqli does not support persistent connections when built with libmysql. However ext/mysqli does support persistent connections when built with mysqlnd. To establish a persistent connection with the MySQL server using ext/mysqli and mysqlnd, prepend the database host with the string "p:" (p stands for persistent) as shown below.


$host="p:localhost";
$port=3306;
$socket="/tmp/mysql.sock";
$user="root";
$password="admin";
$dbname="test";

$cxn = new mysqli($host, $user, $password, $dbname, $port, $socket)
        or die ('Could not connect to the database server' . mysqli_connect_error());

ext/mysql, ext/mysqli and PDO_MySQL support persistent connections when built with mysqlnd.

The new API call mysqli_fetch_all()

mysqlnd extends the ext/mysqli API with one brand new method, …

[Read more]
MySQL Native Driver for PHP, mysqlnd

In order to communicate with the MySQL database server from a PHP application, ext/mysql, ext/mysqli and the PDO MYSQL driver rely on the MySQL client library, libmysql - that has the required implementation for the client-server protocol. The MySQL native driver for PHP (will simply be referred as mysqlnd from this point), is an additional, alternative way to connect from PHP 5 and PHP 6 to the MySQL Server 4.1 or later versions. mysqlnd is a replacement for the MySQL client library, libmysql; and it is tightly integrated into PHP starting with the release of PHP 5.3. That is, from PHP 5.3 onwards the developers can choose between libmysql and mysqlnd when using mysql, mysqli or PDO_MySQL extensions to connect to the MySQL server 4.1 or newer. Due to the tight integration into PHP 5.3 (and later), mysqlnd eliminates the dependency on the MySQL client programming support when the database extension(s) and the database …

[Read more]
MySQL Native Driver for PHP, mysqlnd

In order to communicate with the MySQL database server from a PHP application, ext/mysql, ext/mysqli and the PDO MYSQL driver rely on the MySQL client library, libmysql - that has the required implementation for the client-server protocol. The MySQL native driver for PHP (will simply be referred as mysqlnd from this point), is an additional, alternative way to connect from PHP 5 and PHP 6 to the MySQL Server 4.1 or later versions. mysqlnd is a replacement for the MySQL client library, libmysql; and it is tightly integrated into PHP starting with the release of PHP 5.3. That is, from PHP 5.3 onwards the developers can choose between libmysql and mysqlnd when using mysql, mysqli or PDO_MySQL extensions to connect to the MySQL server 4.1 or newer. Due to the tight integration into PHP 5.3 (and later), mysqlnd eliminates the dependency on the MySQL client programming support when the database extension(s) and the database …

[Read more]
MySQL Native Driver for PHP, mysqlnd

In order to communicate with the MySQL database server from a PHP application, ext/mysql, ext/mysqli and the PDO MYSQL driver rely on the MySQL client library, libmysql - that has the required implementation for the client-server protocol. The MySQL native driver for PHP (will simply be referred as mysqlnd from this point), is an additional, alternative way to connect from PHP 5 and PHP 6 to the MySQL Server 4.1 or later versions. mysqlnd is a replacement for the MySQL client library, libmysql; and it is tightly integrated into PHP starting with the release of PHP 5.3. That is, from PHP 5.3 onwards the developers can choose between libmysql and mysqlnd when using mysql, mysqli or PDO_MySQL extensions to connect to the MySQL server 4.1 or newer. Due to the tight integration into PHP 5.3 (and later), mysqlnd eliminates the dependency on the MySQL client programming support when the database extension(s) and the database …

[Read more]
Direct MySQL Stream Access

Ever wondered what your PHP application and MySQL actually do? An experimental mysqlnd branch will give you full access to the network communication stream. Using a custom PHP stream filter you can then intercept the communication ... but let's start at the beginning:

When talking about mysqlnd - the mysql native driver for PHP - we always mention the fact it's native in a way that we're, when possible, using PHP infrastructure. The most common example here is the memory management. By directly using PHP's memory we can avoid unnecessary copies of data from the MySQL Client Library's memory into PHP memory.

<?php
$mysqli = mysqli_connect("localhost", "root", "", "test");
$stream = mysqli_conn_to_stream($mysqli);

[Read more]
Showing entries 21 to 26
« 10 Newer Entries