View Single Post
Old 05-01-2008, 05:59 PM   #3 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

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:
$q sprintf("UPDATE " TBL_USERS " SET password='%s' WHERE username='%s'"$szPassword$szUsername);

if (
$this->mysqli->query($q)) {
    return 
1;
} else {
    return 
0;

but I'm still curious as to why that one query won't return an object to $result.
-m
delayedinsanity is offline  
Reply With Quote