View Full Version : How to show the name of adoptable in the profile page?
SieghartZeke
10-10-2009, 11:43 AM
Someone know how to add in the profile page a feature that you can show the name of the other adoptable?
Something like this?
http://pokemonepiphany.com/pokepals/levelup.php?id=90
SieghartZeke
10-10-2009, 02:59 PM
Yes...
Just use the ".$name." variable!
SieghartZeke
10-11-2009, 05:18 AM
Ehm....where???
Wherever you want, you just have to pull it from the database first, and most pages already do that.
gabeki
10-11-2009, 12:50 PM
Really? I can just put $name? O:
I did this:
function getcurrentname($id){
include("config.php");
$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE aid='$id'";
$result = mysql_query($query);
$num = mysql_numrows($result);
//Loop out code
$i=0;
while ($i < 1) {
$currentname=@mysql_result($result,$i,"name");
$i++;
}
return $currentname;
}
added that to function.php
and this to every page I wanted to show the name:
$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner = '".$user."'";
$aid=@mysql_result($result,$i,"aid");
$nameofpet = getcurrentname($aid);
and then I use $nameofpet, to show the name
I'm so dumb D:
Yeah. xD
//The adoptable's ID
$aid = @mysql_result($result, $i, "aid");
$currentlevel = @mysql_result($result, $i, "currentlevel");
$type = @mysql_result($result, $i, "type");
$name = @mysql_result($result, $i, "name");
That's just an example of what it is in the myadopts.php page.
Just pull the name from the database.
SieghartZeke
10-11-2009, 02:26 PM
But...when i add $name i cant show the name of my chaarcter in myadopt page!
You have to include the whole thing -
".$name."
SieghartZeke
10-12-2009, 09:39 AM
AHH....BUT I GET SOME DISASTER WHEN I ADD!I SO NOOB!
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.