Ho una query, che voglio convertire in un oggetto JSON.ColdFusion: QUERY to JSON
All'interno della query, è presente una stringa (ad esempio "0000"
o "0001"
). Sfortunatamente, dopo aver chiamato SerializeJSON
, la stringa è un numero (0
, 1
, ...).
Viene visualizzato un errore durante la chiamata delle funzioni con jQuery perché l'oggetto JSON non è valido. Le virgolette sono fallite:
{
"COLUMNS": ["Test1","Test2","Test3"],
"DATA": [ ["AA ",0000,"testestest"] ]
}
Ho già provato così tante cose. Mi potete aiutare?
Ecco il mio codice:
<cffunction name="getData" access="remote" returntype="any" returnformat="JSON">
SQL....
<cfset result = SerializeJSON(result)>
<cfreturn result>
</cffunction>