Login Register

message : missing } in XML expression

the "message : missing } in XML expression" message would be pretty self explanatory except for one thing, I only get it if I go over about 1000 characters in my JSON object.

I have a php page that runs a query against a database and then prints out the results in a JSON format

$result = odbc_exec($conn, $query);
while ($row = odbc_fetch_array($result)) {
$link = "Delete";
$res = $res."{id:'".$row{'id'}."', ref_num:'".$row{'ref_num'}."',status:'".$row{'status'}."',summary:'".$row{'Summary'}."',link:'".$link."'},
";
}
$res = substr($res,0,strlen($res)-1);
$res = $res.']}';

odbc_close($conn);
print $res;

Any help, suggestions, or places to research would be much appreciated.
Thanks,
Stephen

noob error

yup, see that "$row{'Summary'}" up there, that needs to be escaped. A single quote was causing me grief. I'm sure most of you know that, but just in case there's another noob out there, I'm going to post my fix.

Thanks.