Top "Pdo" questions

PDO (PHP Data Objects) is a data-access abstraction layer (interface) for PHP.

Are PDO prepared statements sufficient to prevent SQL injection?

Let's say I have code like this: $dbh = new PDO("blahblah"); $stmt = $dbh->prepare('SELECT * FROM users where username = :…

php security pdo sql-injection
Can I bind an array to an IN() condition?

I'm curious to know if it's possible to bind an array of values to a placeholder using PDO. The use …

php arrays pdo prepared-statement where-in
Laravel Migration Error: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Migration error on Laravel 5.4 with php artisan make:auth [Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key …

mysql laravel pdo laravel-5 laravel-5.4
How do I enable php to work with postgresql?

<?php try { $dbh = new PDO('pgsql:host=localhost;port=5432;dbname=###;user=###;password=##'); echo "PDO connection object created"; } catch(…

php windows postgresql pdo
How to use PDO to fetch results array in PHP?

I'm just editing my search script after reading up on SQL injection attacks. I'm trying to get the same functionality …

php mysql pdo
PDO with INSERT INTO through prepared statements

On my adventure through the jungles of PHP: Data Objects I've encountered a problem with executing MySQL queries through prepared …

php mysql sql pdo
PDO closing connection

Just a rather simple question with regards to PDO compared to MySQLi. With MySQLi, to close the connection you could …

php pdo
PDO Prepared Inserts multiple rows in single query

I am currently using this type of SQL on MySQL to insert multiple rows of values in one single query: …

php pdo insert prepared-statement
How can I properly use a PDO object for a parameterized SELECT query

I've tried following the PHP.net instructions for doing SELECT queries but I am not sure the best way to …

php mysql select pdo
php, mysql - Too many connections to database error

Good day to all. I have an odd error. I have created a chat that works like this: questions/answers …

php mysql zend-framework pdo database-connection