Which PHP function is used to get the number of rows affected by a MySQL query?

WBOY
Release: 2023-08-26 06:06:01
forward
1440 people have browsed it

Which PHP function is used to get the number of rows affected by a MySQL query?

PHP uses the mysql_affected_rows( ) function to find out how many rows were changed by the query. This function basically returns the number of rows affected in a previous SELECT, INSERT, UPDATE, REPLACE, or DELETE query. Returns an integer > 0 indicating the number of rows affected, 0 indicating that no records were affected, and -1 indicating that the query returned an error. Its syntax is as follows -

Syntax

mysql_affected_rows( connection );
Copy after login

The following are the parameters used in the function -

##1.
S. No.

Parameters and description

ConnectionRequired – Specifies the MySQL connection to use

The above is the detailed content of Which PHP function is used to get the number of rows affected by a MySQL query?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:tutorialspoint.com
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!