View Single Post
  #1  
Old 02-25-2017, 10:49 AM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 89,999
Dinocanid is on a distinguished road
Default Problem with adopt with most clicks

I've run into an odd problem where the adoptable with the most clicks will pick my adoptable, when it shouldn't be. Like this:

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(); 
(The code that's showing my pet)
This should get the information of the adoptable with the most clicks, but it seems to only pick my adoptable, which doesn't have the most clicks. What's weird about it is that there's other identical code in the script that works correctly, but this one strangely does not. Maybe I need another pair of eyes to spot the difference, if there is one:
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(); 
(The code that works)
__________________
Reply With Quote