Hello,
I'm want to upload a comma-delimited file and then create a table and then read the values from the file into it. I know that the LOAD DATA INFILE function/query can be used. However, it's not working for me, this is the code I"m using:
$sqlCreate = "CREATE TABLE $servertable";
mssql_query($sqlCreate);
//if(@mssql_query($sqlCreate)){
// echo("Table Created Successfully!");
//}else{
// echo("Error creating table!");
//}
$sqlRead = "LOAD DATA INFILE '$uploadedfile' INTO TABLE $servertable FIELDS TERMINATED BY ','";
mssql_query($sqlRead);
//if(@mssql_query($sqlRead)){
// echo("Table Data read into table Successfully!");
//}else{
// echo("Error reading data into table!");
//}
the comments are because i wanted to see the error. It says that I have improper syntax with the first query near $servertable. And also in the second query near DATA. Any help of what I can and should do is much appreciated. Thanks is advance.
Bubba