3/23/2009

Exercise 8


8.1. Start with a simple table in the database:
mysql > select * from employees;
a.) create a table named employees as the below screendumps.

b.) Insert a record to the emloyees tables and select the data from it as the below screendump:
8.2. Create a web page with the following php:


When we execute ex82.php, the output is showed as follows:

8.3. This is how we can add a record and is part of a file to create called add_record.html

a.) Create a html file name add_record.html, please see below screendump.

b.) Input something in the textbox and click button named "Enter information".
c.) Check that new data can be found in employees table, please see the following screendump;

8.4. The corresponding PHP file is add_record.php used with the POST method:
a.) Create a html file named add_record.html with POST method.

b.) Create a php file named add_record.php in order to receive the variables of add_record.html with POST method.


8.5. The last code example shows how to get multiple records:
a.) create a php file named ex85.php


b.) Success to get multiple records, please see the following screendump.





沒有留言:

發佈留言