it
Printable View
it
I think its because your $gid is in your while loop. Might wanna try
PHP Code:$queryleader=
"SELECT GID
FROM GuildMember
WHERE (PID = $arraypid[$i2])";
$resultleader = mssql_query($queryleader)
or die ("Bug -.-");
while($rowleader=mssql_fetch_array($resultleader))
{
$gid[]= $rowleader['GID'];
echo $gid[$i2];
}
fail ^^
the problem is $gid[$i2] is undefinied.
adding it to the while loop is senseless, isn
if it says it's undefined it's obviously not going in to the while loop because the query does not returns any value, run the query you provide strictly in Enterprise Manager and check if it returns something, with the certain id you run this query in script if it returns the value there and still php says it's undefined reffer to the manual, maybe mssql_fetch_array does not return the type you expect it does. But personally i would bet the first reason.
[quote]
fail ^^
the problem is $gid[$i2] is undefinied.
adding it to the while loop is senseless, isn
[QUOTE=Onkelmat;4330620]fail ^^
the problem is $gid[$i2] is undefinied.
adding it to the while loop is senseless, isn
What is the value of $i2? Maybe it's out of array's bounds? Remember that the array builds up containing values into members 0 .. n, where n+1 is the amount of results the mssql returns. Meaning that if $i2 is the PID, it should be like this:
That way PHP would build an array indexed by player IDs, and contiaining the corresponding guild ID.PHP Code:$queryleader=
"SELECT GID, PID
FROM GuildMember
WHERE (PID = $arraypid[$i2])";
$resultleader = mssql_query($queryleader)
or die ("Bug -.-");
while($rowleader=mssql_fetch_array($resultleader))
{
$gid[$rowleader['PID']]= $rowleader['GID'];
echo $gid[$i2];
}