Guest User

Untitled

a guest
Oct 19th, 2018
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2. include "Configuration.php";
  3.  
  4. class Lessons{
  5. private $dbh;
  6.  
  7. public function __construct(){
  8. //these were set in the config file
  9. $hostname = Configuration::HOSTNAME;
  10. $dbname = Configuration::DBNAME;
  11. $username = Configuration::USERNAME;
  12. $password = Configuration::PASSWORD;
  13.  
  14.  
  15. $this->dbh = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password);
  16. }
  17. public function returnAllLessons(){
  18. $sql = "SHOW TABLES;";
  19. $stmt = $this->dbh->prepare($sql);
  20. $result = $this->dbh->exec($stmt);
  21.  
  22. echo $result;
  23.  
  24.  
  25. }
  26. public function returnLessonsInTag($tag){
  27.  
  28. }
  29. public function returnLessonsThatContain($parameter){
  30.  
  31. }
  32.  
  33. }
Add Comment
Please, Sign In to add comment