import.php
511 Bytes
<?php
require_once("../application/run.php");
$db = sdb::getInstance();
if (($handle = fopen("GoPro.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
if(strlen($data[0])>0){
echo $data[0] . "<br />\n";
$id = $db->getOne("select id from code where code=?",array($data[0]));
if(!$id){
$fields_values = array('code'=>$data[0]);
$db->autoExecute("code",$fields_values,DB_AUTOQUERY_INSERT);
}
}
}
fclose($handle);
}
?>