New Horizons Get Schooled Blog

Put the MySQL driver to bed and start using PDO to modernize PHP (PHP)

Put the MySQL driver to bed and start using PDO to modernize PHP (PHP)MySQL is the Greenland shark of the internet, outliving other technologies and growing at a comparably slow pace. Technology has finally overcome MySQL, leaving it archaic. The superior replacement is PHP Data Objects (PDO). Not only does it implement PDO transition investment from several libraries to just one, but it also shortens the time to master the library, reduces maintenance requirements, and trims the number of bugs and points of failure. 

Apply this code to connect with databases using PDO: try { $conn = new PDO ( "mysql: host = localhost; dbname = database ' , $ user , $ pass ) ; $conn -> setAttribute ( PDO :: ATTR_ERRMODE , PDO :: ERRMODE_EXCEPTION ) ; } Catch ( PDOException $e ) {
Echo "ERROR:" . $e -> getMessage ( ) ; }

Posted on 12/27/18 10:00 AM by Get Schooled in PHP

Get Schooled

Written by Get Schooled

Search by Topic

    Lists by Topic

    see all

    Be at the center of it all.

    SUBSCRIBE TO NEWSLETTER

    Knowledge Ninjas

    a web-based service that allows software application end users to access a subject matter expert in real-time via a chat interface to resolve questions or problems they encounter in their specific software.