mysqli and login for patterns.php