updating database code and testscripts
This commit is contained in:
@@ -10,10 +10,19 @@ class DBBoard extends Database{
|
||||
$query->execute();
|
||||
$boardArray = [];
|
||||
while($result = $query->fetch(PDO::FETCH_BOTH)){
|
||||
$board = new Board($result['ID'],$result['name'],$result['permLevel']);
|
||||
$board = new Board($result['ID'], $result['name'], $result['description'], $result['permLevel']);
|
||||
array_push($boardArray, $board);
|
||||
}
|
||||
return $boardArray;
|
||||
}
|
||||
static function registerBoard(Board $board)
|
||||
{
|
||||
$con = self::connectToDB();
|
||||
$query = $con->prepare("INSERT INTO `board` ( `name`, `description`, `permLevel`) VALUES (':name', ':description', :permLevel)");
|
||||
$query->bindParam(":name", $board->getName());
|
||||
$query->bindParam(":description", $board->description());
|
||||
$query->bindParam(":permLevel", $board->permLevel());
|
||||
$query->execute();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user