Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Soft Delete Problem (http://www.mysidiaadoptables.com/forum/showthread.php?t=2259)

SilverDragonTears 07-28-2011 10:51 PM

Soft Delete Problem
 
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.....



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); 


Nemesis 07-29-2011 01:44 AM

dang that kinda sucks. hope you have a backup?

Chibi_Chicken 07-29-2011 02:15 PM

Quote:

Originally Posted by SilverDragonTears (Post 17603)
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.

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:


All times are GMT -5. The time now is 04:31 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.