I have a result set and need to be displayed as it is on the screen.But the problem is while displaying each row of the result set using echo command the order is getting changed.Can anyone say why this is happening and provide me a way to overcome it.Here are my actual and printed outputs.
Actual Result set:
JAIKE-ILENE-WACKI-MAZIE-REGLE-SBJ-KMMU
LVZ-HARTY-MUGZY-STW
MAZIE-SIXIE-SBJ-KMMU
PXT-LOUIE-GATBY-RAZER-BUZIE-JAIKE-ILENE-WACKI-MAZIE
SWANN-GATBY-RAZER-BUZIE-JAIKE-ILENE-WACKI-MAZIE
Output:
JAIKE-SBJ-ILENE-KMMU-WACKI-MAZIE-REGLE
MUGZY-STW-LVZ-HARTY
SBJ-KMMU-MAZIE-SIXIE
ILENE-GATBY-WACKI-RAZER-MAZIE-BUZIE-PXT-JAIKE-LOUIE
WACKI-RAZER-MAZIE-BUZIE-JAIKE-SWANN-ILENE-GATBY
Here is my code
$sql3="SELECT GROUP_CONCAT(l.fix_ident SEPARATOR '-') AS fix_seq,l.airport_ident,x.star_ident,x.transition_ident,
x.fix_ident from corept.std_star_leg l
JOIN
(SELECT DISTINCT c.airport_ident,c.star_ident,c.transition_ident,c.fix_ident
FROM corept.std_star_leg c
INNER JOIN
(SELECT star_ident,transition_ident,max(sequence_num) seq,route_type
FROM corept.std_star_leg
WHERE data_supplier='J'
AND airport_ident='KMMU'
GROUP BY star_ident,
transition_ident)b ON c.sequence_num=b.seq
AND c.star_ident=b.star_ident AND c.transition_ident=b.transition_ident
LEFT JOIN
(SELECT name,trans
FROM skyplan_deploy.deploy_stars
WHERE apt='KMMU'
AND name!=trans) d
ON d.name=c.star_ident
AND d.trans=c.fix_ident
WHERE c.data_supplier='J'
AND c.airport_ident='KMMU' AND d.name is null)x
where l.airport_ident='KMMU' and l.transition_ident=x.transition_ident
and l.star_ident=x.star_ident and l.data_supplier='J'
group by x.star_ident,x.transition_ident
order by l.star_ident,x.transition_ident,l.sequence_num";
$res3=mysqli_query($mysqli,$sql3);
if($res3)
{
while($newArray3=mysqli_fetch_array($res3,MYSQLI_ASSOC))
{
$apt=$newArray3['airport_ident'];
$star_ident=$newArray3['star_ident'];
$trans_ident=$newArray3['transition_ident'];
$fix_ident=$newArray3['fix_ident'];
$fix_seq=$newArray3['fix_seq'];
echo $apt.",".$star_ident.",".$trans_ident.",".$fix_ident.",COREPT,".$fix_seq;
echo "<br>";
}
}
else
{
printf("ERROR:%s\n",mysqli_error($mysqli));
}