CREATE TABLE `tbl_attend` (
`id_attend` int(11) NOT NULL auto_increment,
`id_researcher` int(11) NOT NULL,
`id_institution` int(11) NOT NULL,
`id_type` int(11) NOT NULL,
`begin` text character set utf8 NOT NULL,
`issue` text character set utf8 NOT NULL,
PRIMARY KEY (`id_attend`)
โครงสร้างตาราง `tbl_bold`
--
CREATE TABLE `tbl_bold` (
`id_bold` int(11) NOT NULL auto_increment,
`id_researcher` int(11) NOT NULL,
`id_type` int(11) NOT NULL,
`special` text character set utf8 NOT NULL,
PRIMARY KEY (`id_bold`)
2 ตารางนี้ เป็นการเชื่อมโยงกันของข้อมูล
โครงสร้างตาราง `tbl_institution`
--
CREATE TABLE `tbl_institution` (
`id_institution` int(11) NOT NULL auto_increment,
`institution` text character set utf8 NOT NULL,
`detail_service` text character set utf8 NOT NULL,
`charge` text character set utf8 NOT NULL,
`service_pdf` text character set utf8 NOT NULL,
`tel` text character set utf8 NOT NULL,
PRIMARY KEY (`id_institution`)
โครงสร้างตาราง `tbl_researcher`
--
CREATE TABLE `tbl_researcher` (
`id_researcher` int(11) NOT NULL auto_increment,
`researcher` text character set utf8 NOT NULL,
`pic` text character set utf8 NOT NULL,
PRIMARY KEY (`id_researcher`)
โครงสร้างตาราง `tbl_type`
--
CREATE TABLE `tbl_type` (
`id_type` int(11) NOT NULL auto_increment,
`types` text character set utf8 NOT NULL,
PRIMARY KEY (`id_type`)
$sql = "SELECT * FROM tbl_attend
LEFT JOIN tbl_researcher ON (tbl_attend.id_researcher=tbl_researcher.id_researcher)
LEFT JOIN tbl_institution ON (tbl_attend.id_institution=tbl_institution.id_institution)
LEFT JOIN tbl_bold ON (tbl_attend.id_researcher=tbl_bold.id_researcher)
LEFT JOIN tbl_type ON (tbl_attend.id_type=tbl_type.id_type)
WHERE tbl_type.id_type = '1'
order by tbl_attend.id_researcher limit $goto,$list_page";