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 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.