![]() |
MySQLi wierdness?
I just ported everything to MySQLi, and everything else works just fine, but for some reason I'm getting wierdness on this query;
PHP Code:
Notice: Trying to get property of non-object in...$result should be an object. It is in every other mysqli->query I do. Why isn't it here? The query works, it does what it's supposed to do, it just doesn't return $result like it's supposed to. I'm lost. -m |
php Code:
Like that? |
According to the documentation, $result should be an object returned by the query, and the actual location of the variable would be $result->affected_rows. $this->mysqli->affected_rows just returns 0, and $this->mysqli->num_rows doesn't exist (as you're supposed to use $result->num_rows). It works just fine in my other database queries, which is why it's wierding me out that it's not returning $result for this one.
I wound up changing it to; PHP Code:
-m |
See, I just ran a test on another function which does this;
PHP Code:
OH DAMN. Nevermind, I bow down to your genius. You're right, when it's an UPDATE, it returns to the mysqli object, there is no $result object. Geebus. -m |
For future reference, PHP: mysqli->affected_rows - Manual
|
Yeah, I know that now. I was looking for it in mysqli_result. Just started using the whole deal this morning, but I likes, I likes.
-m |
| All times are GMT. The time now is 05:08 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0