|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-08-07 07:44 UTC] liyang1025 at gmail dot com
[2020-12-11 23:05 UTC] dharman@php.net
-Status: Open
+Status: Verified
-PHP Version: 7.2.8
+PHP Version: 7.2.0
[2020-12-11 23:05 UTC] dharman@php.net
[2020-12-11 23:12 UTC] rtrtrtrtrt at dfdfdfdf dot dfd
[2020-12-11 23:33 UTC] php at darkain dot com
[2020-12-11 23:42 UTC] rtrtrtrtrt at dfdfdfdf dot dfd
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 06:00:01 2025 UTC |
Description: ------------ The MYSQLI_OPT_READ_TIMEOUT option cannot be changed after a connection is established. This means if it is set to a low value to ensure a stable initial connection to the MySQL server, it cannot be raised back up again before executing long running queries. Test script: --------------- <?php $connection = mysqli_init(); //ensure we receive a reply from mysql in under 1 second $connection->options(MYSQLI_OPT_READ_TIMEOUT, 1); //connect to the mysql server $connection->real_connect($server, $username, $password, $database); //change timeout to 1 hour so we can run a long query $connection->options(MYSQLI_OPT_READ_TIMEOUT, 60*60); //attempt to pull results from a very large table, something that would exceed the initial 1 second timeout value, but not the 1 hour timeout value $connection->query('SELECT * FROM `huge_table`');