Advertisement
Guest User

Untitled

a guest
May 25th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public function create($LHID,$LO_Name,$Province,$Municipality,,$Date_Inserted)
  2. {
  3. try{
  4. $stmt = $this->db->prepare("SELECT count(*) FROM rlbet WHERE LHID = :LHID");
  5. $stmt->execute(array(':LHID'=>$LHID));
  6. $number_of_rows = $stmt->fetchColumn();
  7.  
  8. if($number_of_rows < 1){
  9.  
  10. $stmt = $this->db->prepare("INSERT INTO rlbet(LHID, LO_Name, Province, Municipality, Date_Inserted) VALUES (:LHID, :LO_Name, :Province, :Municipality, :UNIX_TIMESTAMP)");
  11. $stmt->bindparam(":LHID", $LHID);
  12. $stmt->bindparam(":LO_Name", $LO_Name);
  13. $stmt->bindparam(":Province", $Province);
  14. $stmt->bindparam(":Municipality", $Municipality);
  15. $stmt->bindparam(":Date_Inserted", $Date_Inserted);
  16. $stmt->execute();
  17. return true;
  18. }
  19. else{
  20. echo "<script type='text/javascript'>alert('LHID Already Exist'); </script>";
  21. }
  22. }
  23. catch(PDOException $e)
  24. {
  25. echo $e->getMessage();
  26. return false;
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement