Questions tagged [php]
Use ONLY if PHP is directly relevant to the question and likely to be the source of your problem, not just because you're using a PHP library to connect to a database. PHP stands for Professional Hypertext Preprocessor, a widely used platform for dynamic web applications. If you have a general programming question about PHP, please ask it on Stack Overflow instead.
673 questions
0
votes
0
answers
77
views
How to fix “Access denied for user 'root'@'localhost'” in MySQL?
I'm trying to connect to my local MySQL database from PHP.
But I always get this error:
Access denied for user 'root'@'localhost' (using password: YES)
Here is my connection code:
<?php
$servername ...
0
votes
0
answers
36
views
Table is freeze, not able to do any change in Innodb table in MySQL
I am using MySQL 8.0. I have a sales table with only 30,000 rows. I had a problem where the table was frozen and I couldn't alter the values in any of the columns. I attempted to duplicate the data ...
1
vote
0
answers
29
views
where is your vendor location from Composer?
My vendor directory from Composer is in the Home directory of my Linux user account. And I am very allergic to loading files into projects with something arbitrary as the user account name in the ...
0
votes
0
answers
30
views
Help with Creating an ERD and Logical Data Model for a Medical Management Application
A social security organization wishes to develop an application to manage patients, their attending a generalist, and specialist doctors. A person is either a beneficiary or a doctor; a doctor can ...
0
votes
1
answer
129
views
Redis server error: "Cannot assign requested address" under high traffic from Nginx to PHP to Redis
I'm experiencing an issue with my Redis server where I get the following error under high traffic:
Cannot assign requested address
my php code:
<?php
$redis = new Redis();
try{
$redisConnected ...
0
votes
1
answer
49
views
PHP script fast on local MariabDB 10.2.44 but significantly slower on remote MariabDB 10.5.22
I have a PHP 7.2 script which uses MySQLi to connect to a MariaDB database. On an older host running CentOS 7 and MariabDB 10.2.44, the script running locally completes in about 10 seconds. This is ...
0
votes
1
answer
105
views
PHP PDO error "Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause"
I am trying to use the pdo_mysql PHP extension with emulation of prepared statements disabled.
The code is equivalent to the following:
$db_connection = new PDO(
$prefix . ':dbname=' . $...
0
votes
0
answers
339
views
Frequent MySql client error "got an error writing communication packets"
I have several different Linux servers running MySQL 8.0.x instances (ranging from 8.0.23 to 8.0.33).
I occasionally get "error writing communication packets" from clients when connecting to ...
0
votes
0
answers
190
views
MAMP PRO 6.9, PHP 8.2.0, Mac 14.21 and Mongo DB - Apache Fails
Have been trying to get MongoDB installed on MAMP PRO 6.9, PHP 8.2.0, Mac 14.21 via PECL but after a successful install and enabling the extension, when restarting MAMP Pro, Apache fails and none of ...
-1
votes
1
answer
299
views
Embedding PHP variable into Sqlite statement
I have been struggling with this for hours. I am pretty new to Sqlite and have been trying to write a prepared statement, everything works up until I try to get my variable in.
The following works as ...
1
vote
1
answer
307
views
Optimize MariaDB for Drupal 10 to handle more users [closed]
I have problems with my Drupal 10/MariaDB 10.5/PHP 8.1 website when they are 20 users simultaniously.
The website goes down and the response time is really big (up to 30seconds sometimes) because php-...
1
vote
1
answer
127
views
how to speed up and optimize mysql search with indexes
I need to optimize performance on a search with lots of strings like Z1719121.
my table structure:
codfabrica => varchar 191 => nullable
codoriginal => varchar 191 => nullable
aplicacao ...
0
votes
0
answers
165
views
Simple update query slow in php, quick in phpmyadmin
I have a very interesting issue.
A super simple update takes about 400 ms.
The website server waiting (TTFB) is usually around 150 ms, but with this update included it becomes 600 ms.
mysqli_query($...
2
votes
2
answers
2k
views
PosgtreSQL — Is it possible to specify a sequence name in a GENERATED BY DEFAULT AS IDENTITY column?
When using PHP’s lastInsertId() method with PostgreSQL, it’s necessary to know the name of the sequence.
If I defined the column using GENERATED BY DEFAULT AS IDENTITY, I know I can get the sequence ...
0
votes
0
answers
377
views
Trying to import large sql file in MySQL fails
I am trying to import an SQL file that is 685MB into MySQL.
First I tried it through phpmyadmin - it failed.
Then I tried through the command line with:
mysql -u root -p database-name < file.sql
...