PDO & MySQL: Connect to MySQL DB using PDO & CRUD Operations

PDO & MySQL: Connect to MySQL DB using PDO & CRUD Operations

Language: English
Created by: Armstrong Nana TAGU
Rate: 5.0/ 1 ratings
Enroll: 2,266 students

What you’ll learn

  • 1- Connect to MySQL Database using PDO
  • 2- Write simple PDO queries without parameters
  • 3- Write PDO queries with parameters –Prepare statements
  • 4- Get data out of statements using –foreach(), fetch(), fetchAll()
  • 5- Getting data out of statement – PDO::rowCount() – the proper use of the rowCount() function
  • 6- Getting affected rows and last insert id
  • 7- Write a PDO Wrapper class and methods
  • 8- Error handling and Exceptions

Requirements

  • 1. Basic knowledge in PHP , and MySQL (Basic Concept in PHP & MySQL, are not covered in the course)
  • 2. Comfortable working with any PHP development environment – XAMPP, MAMP, WampServer, EasyPHP etc
  • 3. Comfortable working with any text editor – for example: notepad++, Visual Studio Code, Atom, Sublime
  • 4. Knowledge in OOP and PDO will be a plus but not compulsory. Everything is explained from scratch.

Description

  • Do you want to know how to connect to MySQL Database using PDO?
  • Do you want to know how to write PDO Database Wrapper Class and methods the proper way?
  • Do you want to know how to do CRUD operations with PDO?
  • Do you want to know how to use the rowCount() function the proper way? Note that is the most misused function among PHP PDO developers.
  • Do you want to know how to write simple and complex queries with PDO?
  • Do you want to be able to write slim, concise, reusable and secure code?

If your answer to all these is Yes, Then this course is for you.

In this short course, you are going to learn, practice and do some hands-on exercises on how to:

  • Connect to MySQL Database using PDO
  • Write your first PDO Database Wrapper class
  • Write PDO CRUD methods (i.e. function in a class)
  • Write simple queries – queries without parameters
  • Write secure queries with parameters
  • Get data out of statements – using foreach, fetch(), fetchAll(), fetchColumn()
  • Error handling and Exceptions
  • PDO::rowCount() function explained
  • Get affected rows and last insert Id
  • The problem with Limit Clause in prepare statements
  • Write a simple general function and chaining methods

Who this course is for:

  • 1. PHP | PDO enthusiasts
  • 2. Newbie in PDO
  • 3. Freelance web developers who want to get a better grasp in PHP | PDO
  • 4. Intermediate PHP|PDO developers who want to write slimmer, concise, more secure codes.
  • 5. Experience PHP developers who are still struggling with PDO

Leave a Comment

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