Created
April 18, 2018 07:50
-
-
Save thyseus/38b99d14af97233e028b0ed2fdf77b3e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$shop_id = 246, | |
$sql = ''; | |
if (($handle = fopen("DATEI.csv", "r")) !== FALSE) { | |
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { | |
$sql = sprintf('insert into ratings (comment, shop_id, score, import_date, rating_date) | |
values("%s", "%s", "%s", "%s", "%s")', | |
$data[4], | |
$shop_id, | |
$data[2], | |
date('Y-m-d G:i:s') # heutiges Datum (import_date) | |
date('Y-m-d G:i:s', $data[1]), # datum in der .csv (rating_date)) . "\n\n" | |
} | |
} | |
echo $sql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment