When using $mysqli in a custom function, an error is reported. The red line at the bottom of $mysqli indicates
Although $mysqli reports a syntax error, it is marked with a red line. , but the data is still queried, but the loading is super slow, taking dozens of seconds, which is obviously abnormal
This is the database configuration
It is recommended to place require 'mysqli_connect.php'; outside the custom function, at the top of the program. Using the $mysqli variable in a function requires a global declaration. Write global $mysqli;
at the top of the function body.