Home > Backend Development > PHP Tutorial > php uses pdo's like query statement and reports an error indirectly. MySQL server has gone away.

php uses pdo's like query statement and reports an error indirectly. MySQL server has gone away.

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-09-25 09:37:00
Original
1209 people have browsed it

php uses pdo's like query statement and reports an error indirectly. MySQL server has gone away.

As shown in the picture, it is an encapsulated PDO operation, sending sql and retrieving data!

Picture description

A sql statement uses bindColumn() of pdo to implement a like query

php uses pdo's like query statement and reports an error indirectly. MySQL server has gone away.
Option parameters

Error conditions

Indirect error, luckily it can run normally, the connection is mysql installed by myself on Alibaba Cloud, my personal blog runs normally, but I don’t know why the pdo query I wrote reported an error

I have searched many times on the Internet
1. It cannot be that timeout has been set
2.max_allowed_packet is also set to 32M

Reply content:

php uses pdo's like query statement and reports an error indirectly. MySQL server has gone away.

As shown in the picture, it is an encapsulated PDO operation, sending sql and retrieving data!

Picture description

A sql statement uses bindColumn() of pdo to implement a like query

php uses pdo's like query statement and reports an error indirectly. MySQL server has gone away.
Option parameters

Error conditions

Indirect error, luckily it can run normally, the connection is mysql installed by myself on Alibaba Cloud, my personal blog runs normally, but I don’t know why the pdo query I wrote reported an error

I have searched many times on the Internet
1. It cannot be that timeout has been set
2.max_allowed_packet is also set to 32M

You can check the slow check log, and then analyze the slow check log

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Database pdo connection problem
From 1970-01-01 08:00:00
0
0
0
pdo installation
From 1970-01-01 08:00:00
0
0
0
$pdo->exec($sql);Why does it always return false?
From 1970-01-01 08:00:00
0
0
0
PHP PDO predefined constants
From 1970-01-01 08:00:00
0
0
0
PDO query data error
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template