$sql[0] = "CREATE TABLE hsa25 (
id int(11) NOT NULL auto_increment,
cline varchar(5) NOT NULL default '',
carlender date NOT NULL,
Hour varchar(5) NOT NULL default '',
min varchar(5) NOT NULL default '',
cShift varchar(5) NOT NULL default '',
cMachine varchar(30) NOT NULL default '',
cNumber varchar(30) NOT NULL default '',
problem varchar(200) NOT NULL default '',
name varchar(30) NOT NULL default '',
cPosition varchar(15) NOT NULL default '',
cSection varchar(15) NOT NULL default '',
Hour1 varchar(5) NOT NULL default '',
min1 varchar(5) NOT NULL default '',
sum1 smallint,
cdowntime varchar(20) NOT NULL default '',
name1 varchar(30) NOT NULL default '',
cdate date NOT NULL default '',
Hour2 varchar(5) NOT NULL default '',
min2 varchar(5) NOT NULL default '',
cause varchar(200) NOT NULL default '',
action varchar(200) NOT NULL default '',
name2 varchar(30) NOT NULL default '',
name3 varchar(30) NOT NULL default '',
name4 varchar(30) NOT NULL default '',
PRIMARY KEY (id)) ";
// สร้างตาราง hsa3.5 Code
$sql[1] = "CREATE TABLE hsa35 (
id int(11) NOT NULL auto_increment,
cline varchar(5) NOT NULL default '',
carlender date NOT NULL,
Hour varchar(5) NOT NULL default '',
min varchar(5) NOT NULL default '',
cShift varchar(5) NOT NULL default '',
cMachine varchar(30) NOT NULL default '',
cNumber varchar(30) NOT NULL default '',
problem varchar(200) NOT NULL default '',
name varchar(30) NOT NULL default '',
cPosition varchar(15) NOT NULL default '',
cSection varchar(15) NOT NULL default '',
Hour1 varchar(5) NOT NULL default '',
min1 varchar(5) NOT NULL default '',
sum1 smallint,
cdowntime varchar(20) NOT NULL default '',
name1 varchar(30) NOT NULL default '',
cdate date NOT NULL default '',
Hour2 varchar(5) NOT NULL default '',
min2 varchar(5) NOT NULL default '',
cause varchar(200) NOT NULL default '',
action varchar(200) NOT NULL default '',
name2 varchar(30) NOT NULL default '',
name3 varchar(30) NOT NULL default '',
name4 varchar(30) NOT NULL default '',
PRIMARY KEY (id)) ";
$strSQL = "SELECT * FROM hsa25 inner join hsa35 on hsa25.id = hsa35.id WHERE (hsa25.carlender LIKE '%".$_GET["txtKeyword"]."%') or (hsa35.carlender LIKE '%".$_GET["txtKeyword"]."%')";