Which function is used in php to count the total number of rows returned by any query?



Which function is used in php to count the total number of rows returned by any query?..

Answer / Rajesh Singh

In PHP, you can use the mysqli_num_rows() or pg_num_rows() (for PostgreSQL) functions to count the total number of rows returned by a query. Here's an example:nn```phpn$result = mysqli_query($connection, 'SELECT * FROM table');n$numRows = mysqli_num_rows($result);necho $numRows; // Output: The total number of rows returned by the query.```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

Write syntax to open a file in php?

1 Answers  


How to check a key exist in an array?

1 Answers  


What is the importance of parser in php?

1 Answers  


How to find second highest salary

9 Answers  


What are the __construct() and __destruct() methods in a php class?

1 Answers  


How to use the COM components in PHP?

2 Answers   HCL,


What is the maximum size of a table in mysql?

1 Answers  


What is explode() in php?

1 Answers  


What is the importance of "method" attribute in a html form?

1 Answers  


What is mvc php?

1 Answers  


What are php string functions?

1 Answers  


How to check whether cookies are disbled or not in the browser ? If that is the case how do you handle the sessions ?

1 Answers  


Categories