![]() |
#2
|
||||
|
||||
![]()
Try storing $this->female->getAdoptID() for the mother and $this->male->getAdoptID() for the father.
Once that information exists in the database for a pet, you can also lookup grandparents. (Without calling getAdoptID() again, actually, because it's just pulling the information from a column in the database with the names of whatever you store the mother/father data as. If you store it in the database as 'mother' and 'father' you'll want to pull $this->female->mother, $this->female->father, for example, to get the grandparents on the mother's side.) And then you can store information about the grandparents, too. PHP Code:
On your pet profiles, this will create links to the parents by the names (and if no parent, "---" and it will link to the same pet that it's currently on). I've actually got this sitting in a function in class_ownedadoptable.php, but it shouldn't be too bad to move around elsewhere? (The $this may need to change.) PHP Code:
Code:
Parents: <a href='../../levelup/click/".$p1id."'>".$p1name."</a> and <a href='../../levelup/click/".$p2id."'>".$p2name."</a> PHP Code:
I haven't gotten around to displaying grandparents yet, but it's pretty much the same as for the parents. (edit: I woke up a few hours later and changed a couple things. Btw, that last chunk of code is hilarious to read out loud when you're super tired.) (edit later: If using this in myadoptsview.php instead of making a function to call in class_ownedadoptable.php, change every instance of $this-> to $adopt-> and that's the only difference.)
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 02-11-2016 at 11:39 PM. |
|
|
What's New? |
What's Hot? |
What's Popular? |