I discovered this problem yesterday, and it's that showing the information of the pet with the most clicks will not always work, but there doesn't seem to be any pattern to when it works and when it doesn't.
PHP Code:
$topclicks = $mysidia->db->select("owned_adoptables", array("totalclicks"), "Type='{$species}'", "1 ORDER BY totalclicks DESC LIMIT 1")->fetchColumn();
$topadopt = $mysidia->db->select("owned_adoptables", array("name"), "Type='{$species}'", "1 ORDER BY totalclicks DESC LIMIT 1")->fetchColumn();
$topadoptowner = $mysidia->db->select("owned_adoptables", array("owner"), "Type='{$species}'", "1 ORDER BY totalclicks DESC LIMIT 1")->fetchColumn();
I use this code to get the name, name of the owner, and amount of clicks of the most clicked adoptable of that species. It will sometimes pick my pet, which doesn't have the most clicks. The problem is that I have the exact same line of code repeated throughout my php file, and sometimes it works and sometimes it does not.
PHP Code:
$topclicks = $mysidia->db->select("owned_adoptables", array("totalclicks"), "Type='{$species}'", "1 ORDER BY totalclicks DESC LIMIT 1")->fetchColumn();
$topadopt = $mysidia->db->select("owned_adoptables", array("name"), "Type='{$species}'", "1 ORDER BY totalclicks DESC LIMIT 1")->fetchColumn();
$topadoptowner = $mysidia->db->select("owned_adoptables", array("owner"), "Type='{$species}'", "1 ORDER BY totalclicks DESC LIMIT 1")->fetchColumn();