Soft Delete Problem

Forum
Last Post
Threads / Messages

SilverDragonTears

I am your Nemesis.
Premium Member
Joined
Jun 1, 2011
Messages
1,113
Points
36
Mysidian Dollar
51,802
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.
 
Ok pretty sure this is why.....



PHP:
// 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:
	// 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);
 
Last edited:
Ok pretty sure this is why.....



PHP:
// 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:
	// 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:
	$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.
 
I'm no hero, the real hero here is fans. Lots of big fans running really high.
It's too freaking hot >.<
 
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 :)
 
that's the exact way i am!!! i can not stand to be hot though... it makes me depressed LOL!
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,278
Messages
33,127
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top