People | Computer Science | Kansas State University



PHP- MYSQL TUTORIAL

This tutorial helps in learning how to insert the data into the database and how to retrieve it from the database.

This application displays the details students assigned to an advisor when an advisor is selected. We can also enter the details of a student and store in the database.

Below is the enumeration of steps I fallowed to develop this application:

First we create an index.html file in a new folder student in public_html folder. Now change the permissions of the student folder to 755 and also the file permissions in that folder should be set to 644.

The index page looks as below it has two active links which will take to the appropriate page when you click on the link. The index page has the fallowing code in it:

[pic]

The first hyperlink directs to the page in which we can enter the details of a student and here all the details of a student are stored in the database.

The second hyperlink directs to a page where we can enter the name of an advisor so that all the details of the students assigned to that advisor are displayed.

In the second step connect to the MySql database using the MySql account username and password.

[pic]

In this step create the tables in the database which you require in the application. Here I created two tables studentt for storing the details of a student and an Advisor table for storing the details of an Advisor.

[pic]

In the next step we need to specify the number of fields while creating a table, set accordingly the number of fields you need. Now enter the fields into the Advisor table, the fields in that table are name, dept and advisor.

[pic]

Now you can enter the details of a student using the link in an index.html page. Now you can see all those values in the studentt table in the database. The code for this is as fallows:

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download