 <p>Your problem is you lack any form or execution in the given example.</p> <p>You can use PDO start with this tutorial: <a href="http://www.mysqltutorial.org/php-querying-data-from-mysql-table/" rel="nofollow">http://www.mysqltutorial.org/php-querying-data-from-mysql-table/</a></p> <p>I would also look up, PHP Classes tutorial, Preventing SQL Injection, Basic PHP OOP and PHP Sessions Tutorial. You may find that this can be implemented more easily with a PHP framework but its better to have a handle on what is happening if you intend to do any code work.</p>