Skip to content

Commit

Permalink
Fix Call to undefined function mysqli_fetch_all() when try a mysql …
Browse files Browse the repository at this point in the history
…query
  • Loading branch information
gnh1201 authored Oct 24, 2024
1 parent e75a5a4 commit dc65f9a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions assets/php/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Namhyeon Go (Catswords Research) <abuse@catswords.net>
* https://github.com/gnh1201/caterpillar
* Created at: 2022-10-06
* Updated at: 2024-07-15
* Updated at: 2024-10-25
*/

define("PHP_HTTPPROXY_VERSION", "0.1.5.24");
Expand Down Expand Up @@ -289,7 +289,15 @@ function relay_mysql_query($params, $mysqli) {
case "show":
case "select":
$success = true;
$result['data'] = mysqli_fetch_all($query_result, MYSQLI_ASSOC);
if (function_exists("mysqli_fetch_all")) {
$result['data'] = mysqli_fetch_all($query_result, MYSQLI_ASSOC);
} else {
$data = array();
while ($row = $query_result->fetch_assoc()) {
$data[] = $row;
}
$result['data'] = $data;
}
break;

case "insert":
Expand Down

0 comments on commit dc65f9a

Please sign in to comment.