Error ขึ้นมาว่า
Error loading data file.3
The used command is not allowed with this MySQL version
จะเกี่ยวกับ Version ของ SQL เปล่าครับ
หรือว่า พอเปลี่ยนแปลง command ได้
$sql = "LOAD DATA LOCAL INFILE 'uploads/mydata.txt' REPLACE INTO TABLE `table_sql` character set utf8
FIELDS TERMINATED BY ','
ENCLOSED BY ';'
LINES TERMINATED BY '\\r\\n'
IGNORE 5
LINES (
`id` ,
`col2` ,
`col3` ,
`col4` ,
`team1` ,
`team2` ,
`datep` ,
`col7_1` ,
`col7_2` ,
`timep` ,
`col7_4` ,
`col7_5` ,
`datef` ,
`col8_1` ,
`col8_2` ,
`timef` ,
`col8_4` ,
`col8_5` ,
`status_ch` ,
`score1` ,
`score2` ,
`hscore1` ,
`hscore2` ,
`col14` ,
`col15` ,
`col16` ,
`col17` ,
`col18` ,
`col19` ,
`col20` ,
`col21` ,
`col22` ,
`col23` ,
`col24` ,
`col25` ,
`day`
)
SET id = substring(id , INSTR(id, '=')+2 ,LENGTH(id) - INSTR(id, '=') -1 ),
col18 = concat('[',trim(replace(col18 , '\'',' ')),']'),
team1 = trim(replace(team1 , '\'',' ')),
col19 = concat('[',trim(replace(col19 , '\'',' ')),']'),
team2 = trim(replace(team2 , '\'',' ')),
col7_5 = substring(col7_5 , 1 , LENGTH(col7_5) -1),
col7_1 = '".$tomorrow1."',
col7_5 = CONCAT(timep,':',col7_4 , ':' , col7_5),
datep = left(CONVERT_TZ(CONCAT(col7_1 , ' ' , col7_5),'+00:00','+07:00'),10),
timep = right(CONVERT_TZ(CONCAT(col7_1 , ' ' , col7_5),'+00:00','+07:00'),8),
col8_1 = CONCAT(right(datef,4),'-',RIGHT(CONCAT('0' ,col8_1),2),'-' ,right(CONCAT('0' , col8_2),2)),
col8_5 = CONCAT(timef,':',col8_4 , ':' , col8_5),
datef = DATE_ADD(left(CONVERT_TZ(CONCAT(col8_1 , ' ' , col8_5),'+00:00','+07:00'),10) , INTERVAL 1 MONTH),
timef = right(CONVERT_TZ(CONCAT(col8_1 , ' ' , col8_5),'+00:00','+07:00'),8),
col8_1 = DATE_ADD(col8_1 , INTERVAL 1 MONTH),
timep = left(timep, 5),
col22 = CAST(col22 AS DECIMAL(10,2)),
hscore1 = trim(replace(hscore1 , '\'',' ')),
hscore2 = trim(replace(hscore2 , '\'',' ')),
col25 = 'Y',
day = '".$day . "'
";
mysql_query($sql)or die('Error loading data file.3<br>' . mysql_error());
ขอคำแนะนำทีครับ
ปล.ใช้ Vesta CP ครับ
ซึ่งเอาไปทดสอบกับอีกที่นึงที่ใช้ Vesta CP ก็ทำงานปกติ ไม่มี Error ครับ
ขอบคุณครับ