Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public function log_or_skip_record($data, $filename){
  2. $json=json_encode($data);
  3. $hash=md5($json.$filename);
  4. $sql="select id from import_tracking where import_file='{$this->qdb->esc($filename)}' and row_hash='{$hash}'";
  5. $row=$this->qdb->all($sql);
  6. if(count($row)==0){
  7. $sql="insert into import_tracking (import_file,row_hash,json, created)";
  8. $sql.="values ('{$this->qdb->esc($filename)}','{$hash}','{$this->qdb->esc($json)}',NOW())";
  9. $this->qdb->query($sql);
  10. return $data;
  11. }
  12. else {
  13.  
  14. return array();
  15. }
  16. //exit();
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement