This commit is contained in:
Joshua Perry 2023-02-05 12:05:23 +00:00
parent 2fcfd56b39
commit 9c8809a5ee
1 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,9 @@ class DatabaseTable {
public function find($columns, $values, $comparators = ['=', '='], $order = "ASC", $orderColumn = "id") {
$string = 'SELECT * FROM '.$this->table.' WHERE ';
for ($i = 0; $i < count($values); $i++) {
if ($i > 0) {
$string .= 'AND ';
}
$string .= $columns[$i].' '.$comparators[$i].' :value'.$i.' ';
}
$string .= 'ORDER BY '.$orderColumn.' '.$order;