Displaying MySQL Records Using PHP
         by njs12345

This tutorial should do two things. In the first part, I will guide you around installing PHP and MySQL, and preparing the database we will use later. We will also install a tool for writing PHP.

Then we will write a small program to query the database and display the records in a grid.

Installing PHP and MySQL
In order to follow this tutorial, you will most likely need a server. I use a pre-packaged server called WAMP, which you can download here. This includes Apache, MySQL, PHPMyAdmin, and PHP.

  1. Follow the instructions to install WAMP.
     
  2. Then visit http://localhost/phpMyAdmin/ using your web browser, login using the name e_novative(password: e_novative). Enter 'members' in the 'Create new database' field and click Create.
     
  3. Then click the SQL tab, and copy and paste the following into the textbox:

[ paste the above into the textbox ]
 

  1. I would also recommend using an IDE (integrated developement enviroment) to improve the ease of writing code. My pick would be PHPEdit, which can be found here.

[PHPEdit in action]

  1. Now you are ready to move on to the next part of this tutorial. Next, we will start writing the PHP code required to interact with the database..
      

Now, let's continue on to the next page.

   

Next Page

 




SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple.