I'm getting the above error message, could you find out why?
$mysqli=new mysqli("localhost", "***", "***","***") or die($mysqli->connect_error);
fun开发者_如何学运维ction checklogin($username, $password){
global $mysqli;
$result = $mysqli->prepare("SELECT * FROM users WHERE username = ?");
$result->bind_param("s", $username);
$result->execute();
if($result != false){
$dbArray=$result->fetch_array();
You need to make sure PHP is compiled with mysqli built-in (e.g. --with-mysqli). Alternatively, if it's compiled separately as an extension, you need to make sure you're loading it in the appropriate php.ini file (you can check via phpinfo()).
Also, I presume you're using:
global $mysqli;
for the sake of example, but for anyone else stumbling across this, that's potentially a horrible idea.
精彩评论