PDA

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?

Xius
10-10-2009, 02:48 PM
Something like this?
http://pokemonepiphany.com/pokepals/levelup.php?id=90

SieghartZeke
10-10-2009, 02:59 PM
Yes...

Xius
10-10-2009, 03:06 PM
Just use the ".$name." variable!

SieghartZeke
10-11-2009, 05:18 AM
Ehm....where???

Xius
10-11-2009, 10:05 AM
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:

Xius
10-11-2009, 01:05 PM
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!

Xius
10-11-2009, 02:39 PM
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!