Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getBusinessInfo ($id)
- {
- try {
- $sql = "SELECT * FROM businesses WHERE id=:id";
- $stmt = $this->db->prepare($sql);
- $stmt->bindValue(':id',$id);
- $stmt->execute();
- $result = $stmt->fetchAll();
- if(time()-$result[0]['updated'] > $this->age){
- $this->yelp->updateBusiness($result[0]['phone'],"update");
- $sql = "SELECT * FROM businesses WHERE id=:id";
- $stmt = $this->db->prepare($sql);
- $stmt->bindValue(':id',$id);
- $stmt->execute();
- $result = $stmt->fetchAll();
- }
- print_r($result[0]);
- return $result[0];
- }
- catch (PDOException $e) {
- die($e->getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement