Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function create($LHID,$LO_Name,$Province,$Municipality,,$Date_Inserted)
- {
- try{
- $stmt = $this->db->prepare("SELECT count(*) FROM rlbet WHERE LHID = :LHID");
- $stmt->execute(array(':LHID'=>$LHID));
- $number_of_rows = $stmt->fetchColumn();
- if($number_of_rows < 1){
- $stmt = $this->db->prepare("INSERT INTO rlbet(LHID, LO_Name, Province, Municipality, Date_Inserted) VALUES (:LHID, :LO_Name, :Province, :Municipality, :UNIX_TIMESTAMP)");
- $stmt->bindparam(":LHID", $LHID);
- $stmt->bindparam(":LO_Name", $LO_Name);
- $stmt->bindparam(":Province", $Province);
- $stmt->bindparam(":Municipality", $Municipality);
- $stmt->bindparam(":Date_Inserted", $Date_Inserted);
- $stmt->execute();
- return true;
- }
- else{
- echo "<script type='text/javascript'>alert('LHID Already Exist'); </script>";
- }
- }
- catch(PDOException $e)
- {
- echo $e->getMessage();
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement