How to Connect to Your MySQL Database Using MySQLi and PDO




In this lesson, you’ll learn how to connect to your MySQL database. You’ll learn how to connect using both MySQLi and PDO. You’ll also learn an easy way to …

Original source


5 responses to “How to Connect to Your MySQL Database Using MySQLi and PDO”

  1. Great tutorial! I have a couple of questions though:
    In 2016, would you recommend using MySQLi or PDO? or it doesn't matter?
    And if I use MySQLi, is it better to use the object-oriented way show in this video, or the procedural way (the mysqli_connect()…)?
    Please reply!

  2. Hello, I got this error message:
    Connect failed: php_network_getaddresses: getaddrinfo failed: No such host is known.
    I'm running through this series on a localhost (wamp) if that is somehow connected.
    How can I fix this problem?
    Thanks in advance.

    edit: nevermind, I've fixed. My "mysqli" attributes order was not correct.

Leave a Reply