ajax won't let me obtain affected_rows |
(04-24-2016, 10:01 AM)cupboy Wrote:(04-24-2016, 01:18 AM)raghavgarg Wrote: If you are choosing OOP style for mysqli query then you have to use mysqli object to use any method/property of mysqli.That looks like how I am already doing it. I've tried it with and without those parenthesis on the end. Sorry, if I was not clear. I wasn't only talking about parenthesis, my main emphasis was on the variable you are using before that You are using $q = $mysqli->query($sql); $rowsAffected = $q->affected_rows(); ^^ I am talking about this variable, this should be "$mysqli" and not "$q" because the property you want to use is of the "mysqli" object. The final code should be like: $mysqli = new mysqli($server, $user, $password, $db_name); $q = $mysqli->query($sql); $rowsAffected = $mysqli->affected_rows; echo $rowsAffected; |
Messages In This Thread |
ajax won't let me obtain affected_rows - by cupboy - 04-23-2016, 11:17 PM
RE: ajax won't let me obtain affected_rows - by raghavgarg - 04-24-2016, 01:18 AM
RE: ajax won't let me obtain affected_rows - by cupboy - 04-24-2016, 10:01 AM
RE: ajax won't let me obtain affected_rows - by raghavgarg - 04-25-2016, 01:01 PM
|