Slim framework tutorial | part 4 : fetching data from MySQL




In this slim framework tutorial, we’ll be connecting our API to a MySQL database. Then, we’re going to be selecting a bunch of data from our database and …

Original source


22 responses to “Slim framework tutorial | part 4 : fetching data from MySQL”

  1. actually you need to set header content type in order to inform the consumer application what's the "content", thank you very much for the this set of tutorials. I am a big fan of PHP and I've learned a few things! Before I forget the use of PDO is about database detachment yes but also a matter of security such as SQL injection.

  2. Nice video David. There's a difference between an ORM and a Framework. Doctrine, Redbean, Idiorm, NOSQL are all ORM's. Codeigniter, Cake are Frameworks. These frameworks also have ORM on them. The ORM's implement Active Record which and uses PDO usually behing the sceans. It really makes my like easier as a developer. It also provides prepared statements automatically which eliminates security issues. My personal favorite is Idiorm & Paris. Just my two cents!

    Active Record
    https://martinfowler.com/eaaCatalog/activeRecord.html

    Idiorm & Paris
    http://j4mie.github.io/idiormandparis/

  3. Hi, your reasoning for choosing MySQLi over PDO, is all wrong, its not about whether the db will change or not – as you say this so rarely happens.

    It's more to do with the direction of the web and how its consumed, speed and security are paramount. PDO has prepared statements and SQL Injection protection built-in, your example does not.

    I appreciate your efforts to inform and educate, but please do so with the best intentions for future development and prepare those who wish to learn a more reasoned and accurate starting point.

    Thank you

Leave a Reply