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.
-
Follow the instructions to install WAMP.
-
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.
-
Then click the SQL tab, and copy and paste the following
into the textbox:
[ paste the
above into the textbox ]
-
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]
-
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.
|