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 in PHP by Kithuzzz
• 11,040 points
20 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,780 points
15,025 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,780 points
1,281 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,780 points
939 views
0 votes
0 answers

PHP switch statement returns invalid output

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

Jun 9 in PHP by Kichu
• 19,040 points
27 views
0 votes
0 answers
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 in PHP by Kithuzzz
• 11,040 points
385 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 in Other DevOps Questions by narikkadan
• 18,480 points
109 views
0 votes
0 answers

MySQL mysql_num_rows();

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

Jun 23 in PHP by narikkadan
• 18,480 points
10 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 in PHP by narikkadan
• 18,480 points
123 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP