Thanks ramones I know about that forgot to include it in my post but the problem was the format of the array after theubie's post i looked at php.net about json_encode the php needs to be formated in a certain way for json to encode it as I wanted.
Thanks for both responses.
The soloution is when building the array you have to put it into an array like so
$json_data = array();
while ($row = mysql_fetch_assoc($sql)) {
$json_data = array(array(array(FIRST BIT OF DATA)), array(array(SECOND BIT OF DATA)), array(array(NEXT BIT OF DATA)), array(array(AND SO ON)));
}
$json_data = json_encode($json_data);
echo '{"c2array":true,"size":[4,1,1],"data":';
echo $json_data;
echo '}';
this example will ouput for a 4 x 1 x 1 array that with a json load in construct 2 will work and load your data in for you.
Sorry localboss did not see your comment there till i come to edit this must have been typing my original out as you commented thanks for the suggestion i have managed to solve this now ace53422013-02-18 21:31:29
I have scoured this forum for this solution for days now - thanks so much for sharing!