If data size of a variable exceeds max. allowed packet size
(max_allowed_packet), you have to specify b in
types and use
mysqli_stmt_send_long_data() to send the data in packets.
Note:
Care must be taken when using mysqli_stmt_bind_param() in conjunction
with call_user_func_array(). Note that mysqli_stmt_bind_param()
requires parameters to be passed by reference, whereas call_user_func_array()
can accept as a parameter a list of variables that can represent references or values.
The ... operator can be used to provide variable-length
argument list, e.g. in a WHERE IN clause.
<?php
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = new mysqli('localhost', 'my_user', 'my_password', 'world');
$stmt = $mysqli->prepare("SELECT Language FROM CountryLanguage WHERE CountryCode IN (?, ?)");
/* Using ... to provide arguments */
$stmt->bind_param('ss', ...['DEU', 'POL']);
$stmt->execute();
$stmt->store_result();
printf("%d rows found.\n", $stmt->num_rows());