View Single Post
  #4  
Old 07-29-2011, 02:15 PM
Chibi_Chicken Chibi_Chicken is offline
Niwatori Kami
 
Join Date: Jun 2011
Posts: 63
Gender: Unknown/Other
Credits: 5,871
Chibi_Chicken is on a distinguished road
Default

Quote:
Originally Posted by SilverDragonTears View Post
Ok pretty sure this is why.....



PHP Code:
// See if the adoptable actually exists...

$query "SELECT * FROM ".$prefix."owned_adoptables as o LEFT JOIN ".$prefix."adoptables as a on a.type=o.type WHERE owner='$loggedinname' and aid='$id'";
$result runquery($query);
$num mysql_numrows($result); 
because it's looking in the adoptables table and they aren't there. How can I make it so that they show up?

ETA:

or this? oy.

PHP Code:
    // We need to get all of the user's adoptables from the database and display them...
    
$query "SELECT * FROM ".$prefix."owned_adoptables, ".$prefix."adoptables, ".$prefix."levels WHERE ".$prefix."owned_adoptables.owner = '{$loggedinname}'"
    
." AND ".$prefix."adoptables.type = ".$prefix."owned_adoptables.type AND ".$prefix."levels.thisislevel = ".$prefix."owned_adoptables.currentlevel AND ".$prefix."levels.adoptiename = "
    
.$prefix."adoptables.type  ORDER BY ".$prefix."owned_adoptables.sort, ".$prefix."owned_adoptables.totalclicks";
    
$result runquery($query);
    
$num mysql_numrows($result); 
So i am not sure where that first set of code is at however you are right that the second query is causing the problem, specifically
$prefix."adoptables.type = ".$prefix."owned_adoptables.type
and
$prefix."levels.adoptiename = ".$prefix."adoptables.type
with a "soft delete" it removes this entry from the DB. So when the query is ran it will return false. leaving sad faces.

My suggested fix is replace that query with this one (no longer using the adoptables table)
PHP Code:
    $query "SELECT * FROM ".$prefix."owned_adoptables, ".$prefix."levels WHERE ".$prefix."owned_adoptables.owner = '{$loggedinname}'"
    
." AND ".$prefix."owned_adoptables.type = ".$prefix."owned_adoptables.type AND ".$prefix."levels.thisislevel = ".$prefix."owned_adoptables.currentlevel AND ".$prefix."levels.adoptiename = "
    
.$prefix."owned_adoptables.type ORDER BY ".$prefix."owned_adoptables.totalclicks"
yay for data redundancy, hope that helps, and brings more happy faces.
Reply With Quote