Guest User

Untitled

a guest
May 20th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public function create($tag,$increment=true,$status=-1)
  2. {
  3. $ret=false; $incCond=""; $statusCond="";
  4. $tag=$this->prepare($tag);
  5. if(strlen($tag)>0)
  6. {
  7. //does the tag already exist?
  8. $existsData=$this->get($tag,true); //by tag title
  9. if($existsData==false OR !isset($existsData["tid"]))
  10. {
  11. $status=intval($status);
  12. if($status>-1 AND $status<4) $status2=$status;
  13. else $status2=1;
  14. $sql="INSERT INTO tags (tid,uid,title,status) VALUES('','".$this->uid."','$tag','$status2')";
  15. $result=$this->db->query($sql);
  16. if($result==false) return false;
  17. else return intval($this->db->lastInsertID());
  18. }
Add Comment
Please, Sign In to add comment