View Full Version : Soft Delete Problem
SilverDragonTears
07-28-2011, 10:51 PM
I did this option:
Soft Delete (Adoptable Retirement) - This option will do a soft delete of this adoptable from your system. Selecting this option will remove the egg image level for this adoptable from your system. Any users who have this type of adoptable as an egg will have them automatically leveled up to Level 1 for this adoptable type. This option closes the adoptable to new adoptions, but will not affect users who already adopted this creature. Note that once you do a soft delete you will no longer be able to edit the levels associated with that adoptable, so think about this carefully.
And now even though it says those adoptables should still be on the users list.... they aren't. And now I have a lot of very unhappy members.
SilverDragonTears
07-28-2011, 11:27 PM
Ok pretty sure this is why.....
// 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.
// 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);
Nemesis
07-29-2011, 01:44 AM
dang that kinda sucks. hope you have a backup?
Chibi_Chicken
07-29-2011, 02:15 PM
Ok pretty sure this is why.....
// 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.
// 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)
$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.
SilverDragonTears
07-29-2011, 02:28 PM
You're my hero!!!!!!!
Thank you =)
Chibi_Chicken
07-29-2011, 02:38 PM
I'm no hero, the real hero here is fans. Lots of big fans running really high.
It's too freaking hot >.<
SilverDragonTears
07-29-2011, 02:43 PM
You are telling me.... it's 101 here. I'm dying =( (NC)
Chibi_Chicken
07-29-2011, 02:52 PM
I dont mind the heat too much but when I got to sleep I NEED it cold; I even crack open the window in the wintertime. The room has got to be cold so I can be warm and snugly in my blankets :)
SilverDragonTears
07-29-2011, 03:16 PM
that's the exact way i am!!! i can not stand to be hot though... it makes me depressed LOL!
Nemesis
07-29-2011, 04:18 PM
since this thread is already de-railed lol I am sitting in the comfort of my cold basement :usedusedused:
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.