A function runs as many times as you call it. Even if you return from it, if you call it again it will return again. The problem is the
return $message;
In the middle. At that moment, the function will quit and the rest of code inside that function won't run at all. This part is like it doesn't exist:
PHP Code:
if (!isset($_POST[‘slot’])) {
$noslot = “You have not selected a slot to place this trinket in.”
return $noslot;
}
else {
$slot = $_POST[‘slot’];
$image = $item->itemname;
$note = "The trinket has been given to this adoptable!";
$mysidia->db->update("owned_adoptables", array("lastbred" => 0), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
$delitem = $item->remove();
return $note;
}