I want to connect a Postgres database with pooling:true. Can we do it with PHP new PDO option? If not are there any reliable options? I want to pass the below parameters(similar) while establishing the connection: Pooling=true;Minimum Pool Size = 2;Internal Command Timeout = 0;Command Timeout = 0; I cannot fi…
Tag: pdo
Debian – Apache MySQL PDO issue but all logs are empty
I’m trying to get a project set up and working but I have some issues with my PDO connection. No big deal, however, it doesn’t matter what logs I’m trying to find – they are all empty. within the php file itself, I have ini_set(‘error_log’, ‘/tmp/php_error.php’)…
insert query mysql throws PDO::exec() expects exactly 1 parameter, 2 given
I’ve pieced together some code I’ve gleaned from the internet: I’m trying to scan a directory to insert file names and index into MariaDB table. My last hurdle it seems is this PDO error: PDO::exec() …
PHP trying to simply a repetitive script involving rowsets
I’m trying to simplify a repetitive script that I’m doing in PHP. I’ve looked at a few loop options but since it involves rowsets being returned from a MySQL stored procedure it’s not acting properly. I’m doing this same script about 15 times to return all the data. Ultimately I&…
SQLSTATE[IMSSP]: Tried to bind parameter number 65536. SQL Server supports a maximum of 2100 parameters
I want to ask something what error is this. I want to display report book to PHP but the result showing like in picture Here is my report book: and here is the result showing in ASP.NET: Answer You need to consider the following: You need to use named (:name) or question mark (?) parameter markers in the prep…
Counting specific rows after dynamical WHERE clause query in PDO
I’m following this tutorial for a dynamical WHERE clause query in PDO. Let’s suppose I have a short version of the tutorial code, just like this: By adding the line $count = $stmt->rowCount();, I could count the rows. Now let’s suppose I have data like this: If I searched for “Smith…
SQLite FTS5 through PHP/PDO – How to bind values while filtering on a column name?
In a FTS5 MATCH clause, column names used as filters are declared with an ending colon, like in: … WHERE ftstable MATCH ‘colname: keyword’ (as per https://sqlite.org/fts5.html#fts5_column_filters) …
Why does PDO::fetchAll() on an UPDATE prepared statement cause “unbuffered queries are active” exception?
PHP Version: PHP 7.4.13 I have run into this issue where a fetchAll() is being called on a prepared statement, with an UPDATE query: While researching for causes for the MySQL error 2014 Cannot execute queries while other unbuffered queries are active exception, it seems that this case is not covered on other…
“PDOException: could not find driver” inside docker container where PDO modules exist
I want to run php-fpm in a docker container, but get an error message after starting the container: Fatal error: Uncaught PDOException: could not find driver. I use php7.4 with event engine and a postgres database in a separate container (I use docker-compose to start them all) and are working on ubuntu20.04.…
php pdo how to pull down and set default values from the database
I would like to ask how I can use the foreach to select the value brought out of the database to the default value. For example: my database value is 15 * 90, how to select option =15 * 90 I use PDO here Answer You need to create a loop to process all the results from the query and