Quick Answer
PDO (PHP Data Objects) provides a unified interface for database access across different databases (MySQL, PostgreSQL, SQLite, etc.). Supports prepared statements (prevent SQL injection). OOP interface. Connection: new PDO("mysql:host=host;dbname=db", $user, $pass). Query: $stmt = $pdo->prepare("SELECT * FROM users WHERE id = ?"); $stmt->execute([$id]); $rows = $stmt->fetchAll().
Answer
PDO is a database abstraction layer supporting prepared statements for secure, consistent DB access.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
PHP interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Ideal for freshers and experienced candidates preparing for PHP roles.