I have a php script that is interacting with the database. It gets an array of the Characters that the user's account has.
I get their account number using
$GetAccNum = "SELECT acct FROM accounts WHERE login = '$user'";
$AccNumResult = mysql_query($GetAccNum);
while ($AccNumRow = mysql_fetch_array($AccNumResult, MYSQL_NUM))
{
$AccNum = $AccNumRow[0];
}
That part works fine.
Now, if they have only one character, i can get their Character name using
$Chars_Exist = "SELECT * FROM characters where acct = $AccNum";
$Chars_Exist_Result = mysql_query($Chars_Exist);
$Chars_Exist_Count = mysql_num_rows($Chars_Exist_Result);
if ($Chars_Exist_Count > 0)
{
$GetChars = "SELECT name FROM characters where acct = '$AccNum'";
$CharResult = mysql_query($GetChars);
while ($CharRow = mysql_fetch_array($CharResult, MYSQL_NUM))
{
echo $CharRow[0];
}
}
My problem is, for example, lets say they have two characters. $CharRow[1] Has no value, both names are stored in $CharRow[0]. How can I get each one assigned to its own number?
Thanks for your help,
SiPex