Database PDO Class and Object

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:05
    with Leanna Pelham
  • 0:09
    We just accomplished more than our first query in PHP.
  • 0:13
    We also have just solved one of the most fundamentally important
  • 0:16
    concepts to almost any programming language.
  • 0:19
    Objects. To talk to the database, we first open
  • 0:23
    a connection using a class called PDO.
  • 0:26
    This returns an object, which we set to the PDO variable.
  • 0:30
    We haven't talked about classes or objects yet,
  • 0:33
    but it's not important for you to understand them.
  • 0:36
    Just know that an object is another PHP data type.
Loading ...

Database PDO Class and Object

Loading...

To talk to the database, we first open a connection using a class called PDO. This returns an object, which we set to the $pdo variable. In this tutorial we're going to talk a little more about what this means and how we use them. We'll also take a quick look at how this "new" object-oriented way of doing things is different from the old, deprecated functions.

Downloads: 
Log in or sign up to download companion files.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.