All Questions
22,171
questions
-1
votes
0
answers
44
views
SQLSTATE[HY000] [2002] No such file or directory (Connection: mysql, SQL: ...) While updating on DB records [duplicate]
Connection to DB is refused only from the website.
PHP 8.2.4
laravel 10.31.0
i have 2 server have the website.
1- has master DB.
2- has slave DB.
.env file for the db master server:
DB_CONNECTION=...
0
votes
1
answer
49
views
Not able to show a pdf / image from binary data in MSSQL using PDO LOB
I go MSSQL database which contains attachments - most of them are PDFs. I want to create simple website, that will display attachment after clicking a button. I got main website prepared (there are ...
-3
votes
1
answer
33
views
PHP XAMPP Config [closed]
I try to connect my php website with a XAMPP Server so I can access my MySQL database. Any Ideas how the config has to look like, because I'm rather stuck with this one.
I tried to make a config but ...
-1
votes
0
answers
31
views
Fatal error: Uncaught PDOException: could not find driver for SQLite [duplicate]
I just created a SQLite database 'data.db'. I want to connect it in this php code:
<?php
$pdo=new PDO('sqlite:./data.db');
$query=$pdo->query('SELECT * FROM posts');
if ($query === false){
...
0
votes
0
answers
30
views
Informix PDO assoc_id error SQLSTATE=HY000, SQLDriverConnect: -25546
It has been about half a year that we have been facing an error on our production server. At the beginning it happened every 2-3 months, but last Friday it happened again and today once again. We have ...
0
votes
0
answers
18
views
SQLSTATE[HY000] [2002] No connection could be made because the target machine was selected [duplicate]
I'm trying to connect my windows machine with xampp, using php with PDO, to a server on the local network (Linux)
<?php
$dbname = "DBNAME";
$user = "USERNAME";
$pass = "...
7
votes
7
answers
672
views
Possible bug with PHP PDO and with PostgreSQL
At the startup of the docker application (with laravel php), for 1 request, connection to database is fine. After the first request I start to get this error.
SQLSTATE[08006] [7] could not send SSL ...
1
vote
1
answer
57
views
PHP is not reading .env file
I am using PHP with PDO to connect to my database.
I want to start using environment variables, so I used the following terminal command:
composer require vlucas/phpdotenv
My .env file now contains ...
0
votes
0
answers
18
views
SQLSTATE[HY093]: Invalid parameter number, fetch data from API [duplicate]
i faced this error when i build API, i want to fetch data that can filter based on 2 category (cpNumber or partNumber).
this is result from postman, status code 500
{"error":"Database ...
0
votes
0
answers
38
views
Why PDO::FETCH_CLASS is working with small results and does not work with large results?
I'm trying to convert my SQL result into a class using PDO::FETCH_CLASS.
The code was working fine, until I encountered a query that generates 83 rows. The query returns two columns, one of type int ...
-2
votes
0
answers
52
views
Why do i get PHP source code and bad chars via SQL output?
Normally i don't have big issues programming PHP and SQL, but i can't really figure out what causes this little bug.
I have a page using PHP and fetching data from a MSSQL server.
I use PDO functions ...
-1
votes
0
answers
46
views
Using a _generator_ to loop through and update the SAME table in PDO [duplicate]
To minimize my memory usage and simplify my code, I wanted to use a generator to loop through a table. But when I update that same table, the generator no longer works as expected.
public function ...
0
votes
0
answers
29
views
Doctrine\DBAL\Driver\PDO\Statement::__construct(): Argument #1 ($stmt) must be of type PDOStatement, null given
I am getting a very unexpected and unusual error that is kinda hard to trace. I'm thinking this might be actually covering some other, maybe driver level issue?
This is Postgres on gcloud, PHP-fpm POD,...
1
vote
0
answers
49
views
How to Enhance Security Against SQL Injection in PHP with PostgreSQL? [duplicate]
I've implemented a PHP script to handle form submissions and insert data into a PostgreSQL database. However, I'm concerned about the potential security vulnerabilities, particularly SQL injection. ...
-3
votes
0
answers
48
views
Uncaught PDOException: SQLSTATE[HY093] Invalid parameter number [duplicate]
The error occurs when I try to update the 'name' and 'description' in the database.
Full error:
Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables ...