My query looks right when I output it, but the data is not being inserted into my table for some reason...am i missing something?
//Populate tracking table with data from csv
$fcontents = file ('tracking.csv');
for($i=0; $i < sizeof($fcontents); $i++) {
$line = trim($fcontents[$i]);
$arr = explode("\"", $line);
#if your data is comma separated
# instead of tab separated,
# change the '\t' above to ','
$sql = "insert into tracking values (";
for($i=0; $i < sizeof($arr); $i++) {
$sql .= $arr[$i] . "";
if($i + 1 < sizeof($arr)) {
$sql .= "\"";
}
}
$sql .= ")";
//implode("\",\"", $arr) .)";
mysql_query($sql) or die(mysql_error());
echo "<font face=verdana size=2>" . $sql ."</font><br>\n";
if(mysql_error()) {
echo mysql_error() ."<br>\n";
}
}
Thanks for your help.