static function addComment($username, $post_id, $in_reply_to, $message) { $tmpeditdate = getdate(); //strptime marche pas $day = $tmpeditdate['mday']; $month = $tmpeditdate['mon']; $year = $tmpeditdate['year']; $editdate = $year . "-" . $month . "-" . $day; //conversion fr->ISO (format bdd) $req = 'INSERT INTO comment (username, post_id, in_reply_to, message, date_time_posted )VALUES(?,?,?,?,?)'; $param = array(0 => array($username, PDO::PARAM_STR), 1 => array($post_id, PDO::PARAM_STR), 2 => array($in_reply_to, PDO::PARAM_STR), 3 => array($message, PDO::PARAM_STR), 4 => array($editdate, PDO::PARAM_STR)); $res = BD::getInstance()->prepareAndExecuteQueryWithoutResult($req, $param); return BD::getInstance()->lastInsertId(); }
public static function modifierNbNewsParPage($nb) { $req = "UPDATE param SET nbNewsParPage=?"; $param = array(0 => array($nb, PDO::PARAM_INT)); BD::getInstance()->prepareAndExecuteQueryWithoutResult($req, $param); }