|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-07-26 15:15 UTC] nlopess@php.net
[2020-02-07 06:11 UTC] phpdocbot@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 09:00:01 2025 UTC |
Description: ------------ The mysqli_real_connect page and the mysqli_options pages differ on the valid option constants that may be passed to mysqli_options. mysqli_real_connect appears to have been updated, while mysqli_options is outdated. On the mysqli_options page, the constant for using the compressed protocol is listed as 'MYSQLI_OPT_COMPRESS.' This, however, results in incorrect behavior. The mysqli_real_connect page lists the constant as 'MYSQLI_CLIENT_COMPRESS,' which does produce the correct behavior. Reproduce code: --------------- //As suggested by mysqli_options documentation $MyConn = mysqli_init(); $MyConn->options( MYSQLI_OPT_COMPRESS, 1 ); if(! $MyConn->real_connect( ... ) ) { print( 'Connection failed: ' . mysqli_connect_error() ); } ... $MyConn->close(); Expected result: ---------------- Expect no output to browser/logs. Actual result: -------------- Warning: options() expects parameter 1 to be long, string given in F:\www\hillel\mysql.php on line 3