Hello, could anybody help me turn the following statement:
for($i=0; $i<sizeof($fcontents); $i++) {
$line = trim($fcontents[$i]);
$arr = explode(",", $line);
$sql = "insert into tblHolidays values ('".
implode("','", $arr) ."')";
mysql_query($sql);
echo $sql ."<br>\n";
if(mysql_error()) {
echo mysql_error() ."<br>\n";
}
}
...into an update query? It's scanning my csv file correctly initially and inserting the rows, but when I come to use it a second time I want to update the existing rows with any new data.
Can't seem to get the right syntax... or maybe I'm going about it all wrong, either way I'm tearing my hair out!