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
PHP中文网2017-09-18 16:16:28
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;