Hi all
I am importing a CSV file and for each line of the file, I store the cell contents into an array as such:
Array
(
[0] => 6
[1] => 1
[2] => Style black
[3] => style-black
[4] => Test text goes here
[5] => 123
[6] => 201
)
However I am using this line of code to help build my SQL query but I can't seem to get the strings with quotes around them in order for the SQL to work properly:
for ($i=1; $i<sizeof($filecontents); $i++) {
$line = trim($filecontents[$i], "\t");
$arr = explode("\t", $line);
$insertquery .= " (".implode(",", $arr)."), ";
}
How can I get this to add quotes around the values with strings?
Many Thanks