Home  >  Article  >  Backend Development  >  How to solve php mysql query error problem

How to solve php mysql query error problem

藏色散人
藏色散人Original
2021-10-25 10:40:453103browse

Solution to php mysql query error: 1. Add specified operation rights for users connected to php; 2. Correct all grammatical errors; 3. Check if there are any problems with the mysql server and modify it.

How to solve php mysql query error problem

The operating environment of this article: Windows7 system, PHP7.1 version, DELL G3 computer

How to solve the php mysql query error problem?

There are several possibilities for the unsuccessful execution of the mysql_query function as follows:

1. No permission to access the table referenced in the query statement

2. The sql statement of the query There is a syntax error

3.mysql server connection exception

Solution:

1.Add specified operation permissions to the user connected to php

2. Correct all syntax errors

3. Check whether there is any problem with the mysql server, such as hardware resource exhaustion, network congestion, etc.

Note:

This The extension is deprecated as of PHP 5.5.0 and will be removed in the future. It should be replaced with the MySQLi or PDO_MySQL extension.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to solve php mysql query error problem. For more information, please follow other related articles on the PHP Chinese website!

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