Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH spread MySQL ORM bind parameters #11434

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/ORM/Connect/MySQLiConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,7 @@ public function parsePreparedParameters($parameters, &$blobs)
*/
public function bindParameters(mysqli_stmt $statement, array $parameters)
{
// Because mysqli_stmt::bind_param arguments must be passed by reference
// we need to do a bit of hackery
$boundNames = [];
$parametersCount = count($parameters ?? []);
for ($i = 0; $i < $parametersCount; $i++) {
$boundName = "param$i";
$$boundName = $parameters[$i];
$boundNames[] = &$$boundName;
}
$statement->bind_param(...$boundNames);
$statement->bind_param(...$parameters);
}

public function preparedQuery($sql, $parameters, $errorLevel = E_USER_ERROR)
Expand Down