nikko50 wrote:Would the below work?
If you had tried it you wouldn't have had to wait seven and a half hours for an answer: no, because $row4 would never be false inside the loop.
You can count the number of rows returned in the result before starting the loop, and use that count inside the loop to tell where you are. Or you can use the loop to put the string data into an array and join() it together with linebreaks after the loop.