When you build an application with PHP 99% at the time you’ll be interacting with some sort of datastore, and this is very often an SQL database SQL stands for structured query language if you’re unfamiliar with SQL databases you should check out the course database foundations SQL databases allow you to save users blog posts Payment information and whatever else your website will need to remember and provide you with an interface to fetch that data back whenever you need it There are many options for working with databases in PHP such as MySQL Postgres and sq our light MySQL is incredibly popular with the PHP community, but if you end up using that you have to be careful There are three extensions that can be used to connect to MySQL databases in PHP MySQL MySQL, I and PDO the MySQL extension is currently deprecated and will be removed from an upcoming version of PHP You shouldn’t use this for anything anymore MySQL and PDO are the only remaining safe options if You’re not using MySQL and decide to go with another popular system like Postgres or SQLite and there are extensions for that too Such as the PG SQL SQL light and also PDO if you’re unsure which to use a sensible option is to always work with PDO PDO allows you to learn one PHP API for interacting with many supported databases This allows you to use the same API to interact with MySQL Postgres and SQLite or many others without having to relearn a brand new set of functions and classes

Choosing a Database Extension – PHP Standard and Practices Part 3
Tagged on:                                             

Leave a Reply

Your email address will not be published. Required fields are marked *