Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "Configuration.php";
- class Lessons{
- private $dbh;
- public function __construct(){
- //these were set in the config file
- $hostname = Configuration::HOSTNAME;
- $dbname = Configuration::DBNAME;
- $username = Configuration::USERNAME;
- $password = Configuration::PASSWORD;
- $this->dbh = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password);
- }
- public function returnAllLessons(){
- $sql = "SHOW TABLES;";
- $stmt = $this->dbh->prepare($sql);
- $result = $this->dbh->exec($stmt);
- echo $result;
- }
- public function returnLessonsInTag($tag){
- }
- public function returnLessonsThatContain($parameter){
- }
- }
Add Comment
Please, Sign In to add comment