Guest User

Untitled

a guest
Aug 21st, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. Connection failed: could not find driver
  2.  
  3. Fatal error: Class 'mysqli' not found in C:Apache24htdocsconexao_db.php on line 7
  4.  
  5. <?php
  6. $servername = "localhost";
  7. $username = "root";
  8. $password = "minha_senha";
  9.  
  10. try {
  11. $conn = new PDO("mysql:host=$servername;dbname=php_db", $username, $password);
  12.  
  13. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  14. echo "Connected successfully";
  15. }
  16. catch(PDOException $e)
  17. {
  18. echo "Connection failed: " . $e->getMessage();
  19. }
  20. ?>
  21.  
  22. include_path = "C:phpincludes"
  23.  
  24. extension_dir = "ext"
  25.  
  26. extension=D:/PHP/ext/php_mysql.dll
  27. extension=D:/PHP/ext/php_mysqli.dll
Add Comment
Please, Sign In to add comment