Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function log_or_skip_record($data, $filename){
- $json=json_encode($data);
- $hash=md5($json.$filename);
- $sql="select id from import_tracking where import_file='{$this->qdb->esc($filename)}' and row_hash='{$hash}'";
- $row=$this->qdb->all($sql);
- if(count($row)==0){
- $sql="insert into import_tracking (import_file,row_hash,json, created)";
- $sql.="values ('{$this->qdb->esc($filename)}','{$hash}','{$this->qdb->esc($json)}',NOW())";
- $this->qdb->query($sql);
- return $data;
- }
- else {
- return array();
- }
- //exit();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement