Link to home
Start Free TrialLog in
Avatar of kevp75
kevp75Flag for United States of America

asked on

Text Injection In Display

Ok, so I'm given a list of parts like so:
PartID    CatID    PartName
0             1           Part 1
1             2           Part 2
2             1           Part 3
3             3           Part 4
4             2           Part 5
5             2           Part 6

I'm using PHP to pull.   How can I inject a blurb of text at each change in CatID, without having to run multiple loops?

So on page:
"BLURB OF TEXT"
Part 1
Part 3
"BLURB OF TEXT"
Part 2
Part 5
Part 6
"BLURB OF TEXT"
Part 4

while($row = sqlsrv_fetch_array($qry, SQLSRV_FETCH_ASSOC)) {
    echo $row["PartName"]
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kevp75

ASKER

actually got it figured out prior to checking the q... but yes, that's what I did.