im having a problem with these to loops in one case it works but wont work with what i need it t do and the other wont work but i ned it to do the other parts of the page. here that code i have
$data = mssql_fetch_assoc($rs);
foreach ($data as $key=>$value) {
echo "<a href=\"?id=player&account=$account&playerid=". $data['char_id'] ."\">". $data['char_name'] ."</a><br />";
}
thats what i need to work(so i can grab data out of $data outside a loop but it will only output the first item in the array 2 times, no matter how many return items there are
while ($row = mssql_fetch_assoc($rs)) {
echo "<a href=\"?id=player&account=$account&playerid=". $row['char_id'] ."\">". $row['char_name'] ."</a><br />";
}
that will output all the items the way i want but i cant just call to the return data outside the loop, the full way it needs to work is like so
$data = mssql_fetch_assoc($rs);
echo "<a href=\"?id=\">Home</a> :: <a href=\"?id=account&account=". $data['account_id'] ."\">". $data['account_name'] ."</a> :: <a href=\"?id=player&account=". $data['account_id'] ."&playerid=". $data['char_id'] ."\">". $data['char_name'] ."</a><br />";
foreach ($data as $key=>$value) {
echo "<a href=\"?id=player&account=$account&playerid=". $data['char_id'] ."\">". $data['char_name'] ."</a><br />";
}
thanks in advance