bean = $bean; $this->bean_id = $bean_id; $this->user_id = $user_id; $db = $GLOBALS['db']; $starExists = $this->checkStar(); } private function checkStar() { $w = $this->db->query("SELECT * FROM stars WHERE bean = '$this->bean' AND bean_id = '$this->bean_id' AND user_id = '$this->user_id"); if ($w->num_rows == 0) return false; else return true; } private function createStar() { if ($this->starExists == false) return; $this->db->query("INSERT INTO stars VALUES ('$this->bean','$this->bean_id','$this->user_id')"); } private function deleteStar() { if ($this->starExists == true) return; //$this->db->query(""); } } ?>