Ooops forgot to mention the most obvious

have you filled in the part at the top with your details.
$checkservername = "localhost"; // hostname or ip of server
$dbcheckusername = "username here"; // user name
$dbcheckpassword = "password here"; // user password
$dbcheckbase = "database name here"; // name of database
$encryptedpw = true; // encrypted (md5) passwords on/off (true/false)
Remember for security always place it in the admin folder and alter the path in the php scripts you want to password.