I got some tasks from my lecture to deploy user complaint form.
I don’t know how to deploy…just try and try. And finally i know how to start. I use PHP and MySQL to deploy it. Generally, I make the form with PHP and html source code. I use 3 tables on MySQL to get Data that i want to show at form. I confuse how to join 3 tables.With help from my friend and GrandPa google, finally I know it. This the topology of that’s 3 tables:
1st table:
+———+————–
| Field | Type
+———+————–
| id | int(10)
| tanggal | varchar(30)
| nama | varchar(100)
| alamat | varchar(200)
| kota | varchar(25)
| email | varchar(150)
| idcom | int(10)
| idwil | int(10)
+———+————–
2nd table:
+——–+————–+
| Field | Type |
+——–+————–+
| idcom | int(10) |
| descom | varchar(100) |
+——–+————–+
3 rd table:
+——–+————–+
| Field | Type |
+——–+————–+
| idwil | int(10) |
| deswil | varchar(100) |
+——–+————–+
from 1 st table , i want to get 2 field idwil and idcom. this two field the same as 2nd table and 3rd table. I want to get deswil from 3rd table and descom from 2nd table. This is the syntax to join both 3 tables:
SELECT tanggal, nama, alamat, email, descom,deswil FROM tugas LEFT JOIN komplain ON tugas.idcom = komplain.idcom LEFT JOIN wilayah ON tugas.idwil = wilayah.idwil ORDER BY id
these will show 3 data from both 3 tables.
Maybe these info help you that have a problem like me..
thank you
-nanta-








1 response so far ↓
drewster // June 11, 2008 at 5:53 pm
good help
Leave a Comment