Skip to content
PathTailor
  • Courses
  • Paths
  • Careers
  • Glossary
  • Companies
  • Schools
  • Pricing
FRSign inBuild my path
PathTailor
  • Courses
  • Paths
  • Careers
  • Glossary
  • Companies
  • Schools
  • Pricing
Build my pathSign inLire en français
  1. Home
  2. Glossary
  3. PDO

PDO

PDO (PHP Data Objects) is PHP's unified interface for accessing databases (MySQL, PostgreSQL, SQLite...). The same access code works with several engines, and PDO supports prepared statements and transactions.

Example

$pdo = new PDO($dsn, $user, $pass);

Related concepts

DSN and connection optionsExceptionsquery() and PDOStatementFetch modesPrepared statementsSQL injectionINSERT, UPDATE, DELETETransactionsRepository patternEntity hydrationSQL pagination

The whole glossary

See this concept in action

Want to go further? Take the PHP and Databases (PDO) course.

Lesson 1 of 5 · 15 min · intermediate levelFree access

Connecting to a Database with PDO

In this lesson, you learn to:

  • understand the role of PDO and database drivers
  • write a DSN for SQLite, MySQL and PostgreSQL
  • configure PDO to throw exceptions and return associative arrays

Read the lessonBuild my path

PathTailor

Your project. Our path.

Courses are being translated into English; those not yet translated open in French. Personalised lessons are produced in the learner's language.

Build my path

Catalogue

  • All courses
  • Paths
  • Careers
  • Glossary

Platform

  • Pricing
  • Blog (French)
  • About

Organisations

  • Companies
  • Schools

Catalogue updated on 12 November 2026 · v1.1 · Legal notice · Terms · Privacy · Cookies ·