Skip to content

Commit

Permalink
适配swoole 5.x在8.3下废弃协程Mysqli客户端
Browse files Browse the repository at this point in the history
  • Loading branch information
kiss291323003 committed Nov 28, 2023
1 parent e297a99 commit 7e60947
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ function query(QueryBuilder $builder,float $timeout = null)
foreach ($builder->getLastBindParams() as $item){
$p .= $this->determineType($item);
}
$p = [$p];
foreach ($builder->getLastBindParams() as $param){
$p[] = $param;
if(!empty($p)){
$p = [$p];
foreach ($builder->getLastBindParams() as $param){
$p[] = $param;
}
$stmt->bind_param(...$p);
}
$stmt->bind_param(...$p);
$stmt->execute();
$ret = $stmt->get_result();
if($ret instanceof mysqli_result){
Expand Down

0 comments on commit 7e60947

Please sign in to comment.