Trying to develop a script to import a csv file into mysql which seems to work so far.
however it does not insert any data into a field called log_date and cant seem to figure out why not ..
The name of the field is correct i tried a field definition of date and of varchar but that doesnt seem to affect it either.
here is the script
note: when testing it will prompt you for the csv file to import the file needs to be in the same directory as import.php and have read rights on it.
hope someone can help me out with this ..
$handle = fopen("$filename", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
$import="INSERT into logins(user_id,user_name,logged,log_date,log_time) values('$data','$data','$data','$data','$data')";
mysql_query($import) or die(mysql_error());
print "Import done";
print "<form action='import.php' method='post'>";
print "Type file name to import:<br>";
print "<input type='text' name='filename' size='20'><br>";
print "<input type='submit' name='submit' value='submit'></form>";