You can actually put your condition inside the query
$count = $mysidia->db->select("owned_adoptables", array("aid"), "owner='{$mysidia->user->username}' and currentlevel >= {$req_lvl}")->rowCount();
That will return how many rows there are with that information. So if user doesn't have an adoptable with that minimum level, it returns 0
$theOne = $mysidia->db->select("owned_adoptables", array(), "owner='{$mysidia->user->username}' and currentlevel >= {$req_lvl} limit 1")->fetchObject();
This will return the whole row. I limited it by one because it might have more than one at max level. So you can access their information now with stuff like:
$hisName = $theOne->name;
__________________
 
asp.net stole my soul.
Last edited by IntoRain; 11-10-2014 at 09:09 PM.
|