mysqli and login for pattern-edit.php
more mysqli for pattern-edit.php
more mysqli for pattern-add.php