Almost done, just the answer system and query is missing
Took 4 hours 10 minutes
This commit is contained in:
@ -56,14 +56,14 @@ class FaqModel
|
||||
return $result['id'];
|
||||
}
|
||||
|
||||
public function addQuestion(int $room_id, bool $question)
|
||||
public function addQuestion(int $room_id, string $question)
|
||||
{
|
||||
$stmnt = Database::getConnection()->prepare( 'INSERT INTO questions ( room_id, question, created_by ) VALUES ( :room_id, :question, :created_by )' );
|
||||
$stmnt->execute( array( 'room_id' => $room_id, $question, 'Anonymous' ) );
|
||||
$stmnt->execute( array( 'room_id' => $room_id, 'question' => $question, 'created_by' => 'Anonymous' ) );
|
||||
|
||||
}
|
||||
|
||||
public function addAnswer(int $question_id, bool $answer)
|
||||
public function addAnswer(int $question_id, string $answer)
|
||||
{
|
||||
$stmnt = Database::getConnection()->prepare( 'UPDATE questions SET answer = :answer WHERE id = :id' );
|
||||
$stmnt->execute( array( 'answer' => $answer, 'id' => $question_id ) );
|
||||
|
Reference in New Issue
Block a user