Another issue I've run into recently. I have a very basic system on my site where users can only adopt/breed a certain amount of adoptables before they need more space. The problem is that users can't seem to buy more than 35 spaces, even if the currency comes out of their account. There also seems to be a problem with users still being able to get adoptables from the adoption center, even though I use the exact same code on the other pages to stop users from going over. I can't seem to do it myself if at full capacity, but other users on the site say that they still can.
PHP Code:
$shelfSpace = $mysidia->db->select("users", array("shelfspace"), "username = '{$mysidia->user->username}'")->fetchColumn();
$adoptAmount = $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}'")->rowCount();
if($userStatus->canbreed == "no") throw new NoPermissionException("permission");
elseif($adoptAmount >= $shelfSpace){
throw new NoPermissionException("Your pantry is full. Try clearing some space or buy an expansion!");
}
(An example of it in breeding.php)
PHP Code:
if($mysidia->input->post("buyspace")){
$mysidia->user->changecash(-100);
$mysidia->db->update("users", array("shelfspace" => ($mysidia->user->shelfspace + 10)), "username = '{$mysidia->user->username}'");
(Part of the code where the users can buy space)
The really strange part is that it seems to be linked to the amount of spaces I have, which is 35. In phpMyAdmin, space is not shared and is stored with the individual user. The system will acknowledge that the user has bought space, but they still won't be able to keep more than 35 pets.