php - finding number of rows affected or retrieveGet the solution ↓↓↓
i am have problems with retrieving the number of rows affected or retrieved from the database. when I check the value of $myslqi->affected_rows it has very unexpected values.
in this code the affected rows says
-1 however there is value in database.. how to check the number of rows in my case
affected_rows returns the number of rows affected by the last INSERT, UPDATE, REPLACE or DELETE query.
In order to get the number of rows in the result, you need to get the
mysql_result object. Try this instead:
affected_rows after a select statement will return the same value as
affected_rows means that there was an error try calling
error on the mysqli object and looking at what the error was (if there is one).
Share solution ↓
Link To Answer People are also looking for solutions of the problem: call to a member function update() on null
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.