PHP MySQLi num rows Always Returns 0

0 votes

In order to make database interaction simpler, I created a class that makes use of MySQLi, a built-in PHP class. I am having trouble getting the num rows instance variable to produce the correct amount of rows after a query is done, though, using an OOP method. Check out this picture of my class...

Why is this incorrect, though? Other numbers from the result object, like "field count," are correct. I sincerely appreciate any assistance.

Aug 7, 2022 in PHP by Kithuzzz
• 38,000 points
1,067 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

Error:PHP Warning: POST Content-Length of 8978294 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

Hello @kartik, 8388608 bytes is 8M, the default ...READ MORE

answered Sep 17, 2020 in PHP by Niroj
• 82,840 points
28,550 views
0 votes
1 answer

How can I enable the MySQLi extension in PHP 7?

Hello @kartik, The problem is that the package ...READ MORE

answered Oct 30, 2020 in PHP by Niroj
• 82,840 points
3,804 views
0 votes
1 answer

How to remove new lines and returns from php string?

Hello @kartik, You need to place the \n in double ...READ MORE

answered Nov 19, 2020 in PHP by Niroj
• 82,840 points
16,799 views
0 votes
0 answers

PHP switch statement returns invalid output

The PHP switch statement returns invalid output : $cond ...READ MORE

Jun 9, 2022 in PHP by Kichu
• 19,040 points
349 views
0 votes
0 answers

PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client

I'm running MySQL version 8 on PHP ...READ MORE

Jun 18, 2022 in PHP by narikkadan
• 63,600 points
1,164 views
0 votes
0 answers

PHP file_get_contents() returns "failed to open stream: HTTP request failed!"

I'm having trouble using PHP code to ...READ MORE

Jul 28, 2022 in PHP by Kithuzzz
• 38,000 points
9,418 views
0 votes
1 answer
0 votes
1 answer

mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in.

The issue is that the query given to mysqli_query() is ...READ MORE

answered May 1, 2022 in Other DevOps Questions by narikkadan
• 63,600 points
1,666 views
0 votes
0 answers

MySQL mysql_num_rows();

The variable: "$num_rows" is not even being ...READ MORE

Jun 23, 2022 in PHP by narikkadan
• 63,600 points
501 views
0 votes
0 answers

How to retrieve data from multiple tables using a PHP form?

I want to retrieve data from multiple ...READ MORE

Jun 25, 2022 in PHP by narikkadan
• 63,600 points
1,965 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP