As its in your question the Database. You need to use a database for this. With PHP, MYSQL is the best option. It is installed with Xampp Server, or you can download the latest version. After installing the MYSQL you need to learn the SQL(Structure Query Language) that will help you to communicate with the database server. You will find so many tutorials on Youtube regarding MYSQL and SQL using with PHP.