/** * inserts a new row into the table with the instancevariables * and sets the id for the current object * * @return bool */ public function create() { $query = "INSERT INTO Blog (name, id_user) VALUES ('" . $this->name . "', '" . $this->user->getId() . "')"; $res = parent::query($query); if ($res) { $this->id = parent::getLastId(); return true; } }
/** * inserts a new row into the table with the instancevariables * and sets the id for the current object * * @return bool */ public function create() { $query = "INSERT INTO Comment (id_entry, id_user, comment) VALUES ('" . $this->entry->getId() . "', '" . $this->user->getId() . "', '" . $this->comment . "')"; $res = parent::query($query); if ($res) { $this->id = parent::getLastId(); return true; } }
/** * inserts a new row into the table with the instancevariables * and sets the id for the current object * * @return bool */ public function create() { $query = "INSERT INTO User (email, nickname, password) VALUES ('" . $this->email . "', '" . $this->nickname . "', '" . $this->password . "')"; $res = parent::query($query); if ($res) { $this->id = parent::getLastId(); return true; } }
/** * inserts a new row into the table with the instancevariables * and sets the id for the current object * * @return bool */ public function create() { $query = "INSERT INTO Entry (id_blog, title, content, date, id_category) VALUES ('" . $this->blog->getId() . "', '" . $this->title . "', '" . $this->content . "', '" . $this->date . "', '" . $this->category->getId() . "')"; $res = parent::query($query); if ($res) { $this->id = parent::getLastId(); return true; } }