View Single Post
  #7  
Old 10-11-2009, 12:50 PM
gabeki gabeki is offline
Premium Member
 
Join Date: Oct 2009
Posts: 24
Gender: Female
Credits: 1,304
gabeki
Default RE: How to show the name of adoptable in the profile page?

Really? I can just put $name? O:

I did this:

PHP Code:
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:

PHP Code:
    $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:
__________________
My Pets site: MaplePet (Released: No)
Done: Stats system, Adoptables Sex system, Battle and using pokeballs like items to capture pets, stats (luck and dexterity) affecting the chance of capturing, Element system (8 elements), Trading, shopping, inventory system, Pet profile for each pet.
Working: Battle System againsts monsters found in the Map
Reply With Quote