(PHP 5 >= 5.3.0, PHP 7, PHP 8)
mysqli::poll -- mysqli_poll — Poll connections
DescriptionObject-oriented style
public static mysqli::poll( ?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0): int|falseProcedural style
mysqli_poll( ?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0): int|falsePoll connections. The method can be used as static.
Note:
Available only with mysqlnd.
Parametersread
List of connections to check for outstanding results that can be read.
errorList of connections on which an error occurred, for example, query failure or lost connection.
rejectList of connections rejected because no asynchronous query has been run on for which the function could poll results.
secondsMaximum number of seconds to wait, must be non-negative.
microsecondsMaximum number of microseconds to wait, must be non-negative.
Return ValuesReturns number of ready connections upon success, false otherwise.
Errors/ExceptionsA ValueError is thrown when neither the read nor error arguments are passed.
ChangelogVersion Description 8.3.0 Now throws a ValueError exception when neither the read nor error arguments are passed. Examples
Example #1 A mysqli_poll() example