Some problems to get characters
#1

im creating a reborn system, ive just one problem with get chars from db.

 

here my code : 

$cong = mysql_connect( $Server["server"] , $Server["user"] , $Server["pass"] ) or die( mysql_error() );
mysql_select_db( $db_char , $cong) or die(mysql_error());
$stringg = "SELECT * FROM `t_characters` WHERE `a_user_index` = ".$_SESSION[user_code]." AND a_enable = 1 ORDER BY a_level desc LIMIT ".$CharacterNumMax."";
$queryg = mysql_query($stringg, $cong) or die(mysql_error());
while ($row = mysql_fetch_array($queryg))
{
$CharID_1 = $row[a_index];
$CharName_1 = $row[a_name];
$CharLevel_1 = $row[a_level];
$CharReborn_1 = $row[a_reborn];
}

But with this code i get just the last character. some one can help me ? i need get all character where a_user_index = $_SESSION[user_code] AND a_enable = 1

 

 

 

Edit : Ive fixed myself lol here the fix :

while ($row = mysql_fetch_array($queryg))
{
if ($Count != $CharacterNumMax) {
$Count = $Count + 1;
$CharCount = $Count;
$CharID[$CharCount] = $row[a_index];
$CharName[$CharCount] = $row[a_name];
$CharLevel[$CharCount] = $row[a_level];
$CharReborn[$CharCount] = $row[a_reborn];
} else {

}
}



Messages In This Thread
[No subject] - by ReturnKratos - 08-09-2013, 09:56 AM
[No subject] - by someone - 08-09-2013, 04:47 PM
[No subject] - by Johnny5 - 08-20-2013, 09:35 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)