So lets get started going through the various parts of the code. At the end I will display it all together and you should be able to read and understand what it is doing.
The first thing to do is set the variables that the script will need in order to work correctly. The variables may change at some point, so we put them at the top of the script where they are easy to find if we need to change them. If they are used multiple times within the script we will only need to edit them in one place.
// Set Script Variables
As I said these variables will be used in various stages of the script. We will
now go through them one by one. $DB_Host should contain the host name where your MySQL resides, in most cases this is 'localhost'. The next three variables are used to connect to your MySQL database; $DB_Name will be the name of the database, $DB_User should contain your MySQL username and $DB_Pass should contain your MySQL password. Finally $Per_Page, this variable defines how many results will be displayed on each page. In this article we are going to display 10 results per page, but you can change this figure to any number that suits your system and layout.