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

$mysqli=new mysqli("localhost", "***", "***","***") ;
		      	die("Database error");
		      function checklogin($username, $password){
		      	global $mysqli;

				$result = $mysqli->prepare("SELECT * FROM users WHERE username = ?");
				$result->bind_param("s", $username);
			if($result != false){
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.