Fix Call to undefined function mysqli_fetch_all() when try a mysql query

This commit is contained in:
Namhyeon Go 2024-10-25 01:51:26 +09:00 committed by GitHub
parent e75a5a4b2d
commit dc65f9a827
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,7 @@
* Namhyeon Go (Catswords Research) <abuse@catswords.net> * Namhyeon Go (Catswords Research) <abuse@catswords.net>
* https://github.com/gnh1201/caterpillar * https://github.com/gnh1201/caterpillar
* Created at: 2022-10-06 * Created at: 2022-10-06
* Updated at: 2024-07-15 * Updated at: 2024-10-25
*/ */
define("PHP_HTTPPROXY_VERSION", "0.1.5.24"); define("PHP_HTTPPROXY_VERSION", "0.1.5.24");
@ -289,7 +289,15 @@ function relay_mysql_query($params, $mysqli) {
case "show": case "show":
case "select": case "select":
$success = true; $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; break;
case "insert": case "insert":