Hey guys, I'm getting the above error, could any of you tell me why? Here's the code

$mysqli=new mysqli("localhost", "***", "***","***") ;
		      if(!$mysqli){
		      	die("Database error");
		      	}
		
		
		      function 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();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.