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.

WBOY
WBOYOriginal
2016-09-25 09:37:001182browse

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

Statement:
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