Advertisement
Guest User

Untitled

a guest
Sep 11th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <?php
  2. class Connect{
  3. private $host = "localhost:9080";
  4. private $user = "root";
  5. private $password = "test123";
  6. private $dbName = "jobber";
  7.  
  8. function __construct(){
  9.  
  10. }
  11.  
  12.  
  13. function connect(){
  14. try{
  15. $connection = new PDO('mysql:host=localhost;dbname=jobber;charset=utf8mb4','root','test123');
  16. }catch(PDOException $ex){
  17. echo $ex;
  18. }
  19.  
  20. return $connection;
  21. }
  22. }
  23. ?>
  24.  
  25. <?php
  26. require_once dirname(__FILE__) . '/connect.php';
  27. $connection = new connect();
  28. $connect = $connection->connect();
  29. ?>
  30.  
  31. Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:xampphtdocsJobberapiconnect.php:9 Stack trace: #0 C:xampphtdocsJobberapitesten.php(4): Connect->__construct() #1 {main} thrown in C:xampphtdocsJobberapiconnect.php on line 9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement