UNIVERSITI TUN HUSSEIN ONN MALAYSIA
FAKULTI PENDIDIKAN TEKNIKAL DAN VOKASIONAL
BBU 40203
PENGATURCARAAN WEB
TUGASAN AMALI
TAJUK : INSERT AND CALL DATA
NAMA NO.MATRIK
NAMA PENSYARAH : DR. AFFERO BIN ISMAIL
TARIKH HANTAR :
TITLE : INSERT AND CALL DATA
AIM : To give knowledge and understanding on how to connect web
with database and perform the insert and call data.
OBJECTIVES : After performing this experiment, the student will be able to:
i) Create a database.
ii) Make a connection with database.
iii) Insert and call data.
EQUIPMENT LIST :
1. Computer
2. Notepad Software
3. Adobe Dreamweaver
PROCEDURE :
Entering Data into the Database
1. Make sure you have your connectivity set up. (See the blog links above.)
2. You must have the connectivity done and the site defined in Dreamweaver.
3. Open the XAMPP console and start MySQL and Apache.
4. Create a new PHP page in the Dreamweaver site you have defined. Save it with no
spaces in the name.
5. Click on Insert > Data Objects > Insert Record > Record Insertion Form Wizard.
6. Choose your Connection from the dropdown.
7. Choose the table that you want to insert the data into.
8. In the “After inserting, go to:” text field, type in the name of the page that will open
automatically after the end user submits the form data. For example, it could go to a
page that displays “Thanks for signing up for our Newsletter.” It can be a simple page
named “thankyou.htm”.
9. Click OK.
10. Save the page, run it, and insert some text into the fields.
11. Click the Insert Record button.
12. Hopefully, you will now see your “thankyou.htm” page. Remember, you have to
create the “ThankYou” page!
Now, let’s create a PHP page to display the data you just entered.
1. Create a new PHP page.
2. Click on the Bindings tab in the upper right corner.
3. Click the little ‘+‘ and choose Recordset (Query).
4. Give the recordset a name, like rsMyRecords.
5. Select the Connection.
6. Select the table from the database that you want to get data from.
7. Select the Test button on the left side. If the connection is successful, you will see all
of the rows from that table.
8. Click OK.
9. Click the expander button next to the record. Then, set and drag a field from your
database over to your new PHP page.
10. Save the page, run the page, and poof! You are displaying data from a database!