Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mysqlnd_uh_convert_to_mysqlnd(3) [php man page]

MYSQLND_UH_CONVERT_TO_MYSQLND(3)					 1					  MYSQLND_UH_CONVERT_TO_MYSQLND(3)

mysqlnd_uh_convert_to_mysqlnd - Converts a MySQL connection handle into a mysqlnd connection handle

SYNOPSIS
resource mysqlnd_uh_convert_to_mysqlnd (mysqli &$mysql_connection) DESCRIPTION
Converts a MySQL connection handle into a mysqlnd connection handle. After conversion you can execute mysqlnd library calls on the connec- tion handle. This can be used to access mysqlnd functionality not made available through user space API calls. The function can be disabled with mysqlnd_uh.enable. If mysqlnd_uh.enable is set to FALSE the function will not install the proxy and always return TRUE. Additionally, an error of the type E_WARNING may be emitted. The error message may read like PHP Warning: mysqlnd_uh_convert_to_mysqlnd(): (Mysqlnd User Handler) The plugin has been disabled by setting the configuration parameter mysqlnd_uh.enable = false. You are not allowed to call this function [...]. PARAMETERS
o $MySQL connection handle - A MySQL connection handle of type mysql, mysqli or PDO_MySQL. RETURN VALUES
A mysqlnd connection handle. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.4.0 | | | | | | | The $mysql_connection parameter can now be of | | | type mysql, PDO_MySQL, or mysqli. Before, only | | | the mysqli type was allowed. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 mysqlnd_uh_convert_to_mysqlnd(3) example <?php /* PDO user API gives no access to connection thread id */ $mysql_connection = new PDO("mysql:host=localhost;dbname=test", "root", ""); /* Convert PDO MySQL handle to mysqlnd handle */ $mysqlnd = mysqlnd_uh_convert_to_mysqlnd($mysql_connection); /* Create Proxy to call mysqlnd connection class methods */ $obj = new MySQLndUHConnection(); /* Call mysqlnd_conn::get_thread_id */ var_dump($obj->getThreadId($mysqlnd)); /* Use SQL to fetch connection thread id */ var_dump($mysql_connection->query("SELECT CONNECTION_ID()")->fetchAll()); ?> The above example will output: int(27054) array(1) { [0]=> array(2) { ["CONNECTION_ID()"]=> string(5) "27054" [0]=> string(5) "27054" } } SEE ALSO
mysqlnd_uh.enable. PHP Documentation Group MYSQLND_UH_CONVERT_TO_MYSQLND(3)

Check Out this Related Man Page

MYSQLI_STORE_RESULT(3)							 1						    MYSQLI_STORE_RESULT(3)

mysqli::store_result - Transfers a result set from the last query

       Object oriented style

SYNOPSIS
mysqli_result mysqli::store_result ([int $option]) DESCRIPTION
Procedural style mysqli_result mysqli_store_result ([int $option]) Transfers the result set from the last query on the database connection represented by the $link parameter to be used with the mysqli_data_seek(3) function. PARAMETERS
o $ link -Procedural style only: A link identifier returned by mysqli_connect(3) or mysqli_init(3) o $option - The option that you want to set. It can be one of the following values: Valid options +------------------------------+---------------------------------------------------+ | Name | | | | | | | Description | | | | +------------------------------+---------------------------------------------------+ | | | |MYSQLI_STORE_RESULT_COPY_DATA | | | | | | | Copy results from the internal mysqlnd buffer | | | into the PHP variables fetched. By default, | | | mysqlnd will use a reference logic to avoid copy- | | | ing and duplicating results held in memory. For | | | certain result sets, for example, result sets | | | with many small rows, the copy approach can | | | reduce the overall memory usage because PHP vari- | | | ables holding results may be released earlier | | | (available with mysqlnd only, since PHP 5.6.0) | | | | +------------------------------+---------------------------------------------------+ RETURN VALUES
Returns a buffered result object or FALSE if an error occurred. Note mysqli_store_result(3) returns FALSE in case the query didn't return a result set (if the query was, for example an INSERT state- ment). This function also returns FALSE if the reading of the result set failed. You can check if you have got an error by checking if mysqli_error(3) doesn't return an empty string, if mysqli_errno(3) returns a non zero value, or if mysqli_field_count(3) returns a non zero value. Also possible reason for this function returning FALSE after successful call to mysqli_query(3) can be too large result set (memory for it cannot be allocated). If mysqli_field_count(3) returns a non-zero value, the statement should have pro- duced a non-empty result set. NOTES
Note Although it is always good practice to free the memory used by the result of a query using the mysqli_free_result(3) function, when transferring large result sets using the mysqli_store_result(3) this becomes particularly important. EXAMPLES
See mysqli_multi_query(3). SEE ALSO
mysqli_real_query(3), mysqli_use_result(3). PHP Documentation Group MYSQLI_STORE_RESULT(3)
Man Page