How do I override this function to dynamically make a select
on more than one table?
public function Lista(){
$results = array();
$stmt = $this->conn->prepare("SELECT * FROM 'tabela'");
$stmt->execute();
if($stmt) {
while($row = $stmt->fetch(PDO::FETCH_OBJ)) {
$not = new Not();
$not->setid($row->ID);
$not->setimg1($row->Img1);
$not->setimg2($row->Img2);
$not->setimg3($row->Img3);
$results[] = $not;
}
}
return $results;
}
Because I need multiple select's in multiple tables, I have not found a simple way, except to do a function for each select. The same is repeated for update
and insert
. Any tips?