Blame view

import/import.php 511 Bytes
8d65d0ce   andryeyev   init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  <?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);
  }
  ?>