Why would you need to clean (whatever you meen by that) results on the way out of a database? All you really need do is format there output so they look appealing. Hence html.
As for protecting your config file. Just make sure it has the .php extension and doesn't output any text. Of course, if you can, keep it outside your website root for added safety.
Sessions are automatically distroyed (users logged out) after a certain amount of time. default is 20mins i think.
Remember me = cookies.