pdo = new PDO( "mysql:host=$servername;dbname=$database", $username, $password ); } public function ScheduleRowForDeletion(string $tableName, string $id) { } public function RunSelect(SelectInterface $queryBuilder): array { $sth = $this->pdo->prepare($queryBuilder->getStatement()); $sth->execute($queryBuilder->getBindValues()); $result = $sth->fetchAll(PDO::FETCH_ASSOC); return $result; } public function RunOneSelect(SelectInterface $queryBuilder): array { $sth = $this->pdo->prepare($queryBuilder->getStatement()); $sth->execute($queryBuilder->getBindValues()); $result = $sth->fetchAll(PDO::FETCH_ASSOC); if(sizeof($result) == 1) return $result[0]; echo "invalid single row db response"; die(); } public function UpdateSingleField(UpdateInterface $queryBuilder): void { $sth = $this->pdo->prepare($queryBuilder->getStatement()); $sth->execute($queryBuilder->getBindValues()); $result = $sth->fetchAll(PDO::FETCH_ASSOC); } public function RunInsert(InsertInterface $queryBuilder): bool { $sth = $this->pdo->prepare($queryBuilder->getStatement()); return $sth->execute($queryBuilder->getBindValues()); } public function RunDelete(DeleteInterface $queryBuilder): bool { $sth = $this->pdo->prepare($queryBuilder->getStatement()); return $sth->execute($queryBuilder->getBindValues()); } }