I've tried that but it's returned undefined on the page. I think it's because I'm putting $balance into the array and I'm using a for each method on the main page. I'll show the code for displaying the results, hopefully this will help.

That's worked however I do realise your correct that the balance shouldn't be part of that array. Now I know how to access the data could you please help me ammended the PHP side of it in regard the array.

What you could do, is store just the 'balance' and 'colour' in the first element of the array and omit it from all the others. Then skip the first record (that contains just 'balance' and 'colour') in your JavaScript loop...