Skip to content

Commit

Permalink
fix MySQLDataSource bind_param in prepareAndBind()
Browse files Browse the repository at this point in the history
  • Loading branch information
dongnl committed Jul 7, 2021
1 parent 85639ac commit fc112ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 231 deletions.
8 changes: 7 additions & 1 deletion src/datasources/MySQLDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,13 @@ function ($k1, $k2) {
(is_int($v) ? "i" : "s");
}
if (! empty($typeStr)) {
call_user_func_array(array($stmt, 'bind_param'), [$typeStr] + $params);
// echo "typeStr=$typeStr<br>";
// echo "[typeStr] + params="; print_r([$typeStr] + $params); echo "<br>";
// echo "...array_values(params) = "; print_r(...array_values($params)); echo "<br>";
$arr = [$typeStr] + $params;
$refArr = [];
foreach($arr as $k => $v){$refArr[] = &$arr[$k];}
call_user_func_array(array($stmt, 'bind_param'), $refArr);
// call_user_func_array(array($stmt, 'bind_param'), array_merge([$typeStr], $params));
// call_user_func_array(array($stmt, 'bind_param'), array_merge([$typeStr], array_values($params)));
// $stmt->bind_param($typeStr, ...array_values($params)); //spread operator ... only available since PHP 5.6
Expand Down
230 changes: 0 additions & 230 deletions src/datasources/OlapDataSource.php

This file was deleted.

0 comments on commit fc112ec

Please sign in to comment.