I am currently attempting to import an .csv file (comma seperated) into MySQL by execiting it with the following code:
$sql2 = "LOAD DATA LOCAL INFILE '$dbase_file.CSV' INTO TABLE `$dbase_file` FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY
'\"' ESCAPED BY '\\\\' LINES TERMINATED BY '\r\n' IGNORE 1 LINES";
$result2 = mysql_query($sql2) or die(mysql_error(). "<br>\n{$sql2}");
Everything goes good except for the formatting of one column.
I have a column with numerical values of:
2.00
94.49
1,000.00
The biggest thing I have is the comma in 1,000.00
The only way I can input it into the dbase is to have the table column as "varchar(10)" instead of what I would like it to be "float(9,2)"
That is fine but I would like to be able to sort using "ORDER BY thatcolumn" and if it is set as "varchar(10)", it will not properly sort.
I know this may be more of a MySQL question BUT this board is awsome and there are quite a few real smart cookies here so I thought I'd ask 😉
Any help would be greatly appreciated!!!