Thank you both for your replies, I now have it working. I have a blank line separating each data line, but that is no big deal.
Re your comments ginerjm, I have followed several on-line tutorials to create my code and I must admit I don't understand all of it. I have searched for a good tutorial and not found one which starts from basics and actually explains how it all works, which results in me copying code, using it and hoping for the best. Some of the tutorials conflict with other, which is not helpful.
The multiple php calls was from a tutorial which maintained that it was clearer that way, but on balance I think I agree with you.
Thanks for your help
Mick