I want use zachhunters json to html tabel script with my postressql db so i need a specific JSON string format but i dont know how to build it ... (i am new in json)
I get my data using
$result = pg_fetch_array($rs, NULL, PGSQL_ASSOC);
When i use json_encode($result)
i get this:
{"id":"2","surname":"Max","name":"Muster"} etc.
For the Script i need somthing like:
{ "d": "[{\"id\":1,\"Username\":\"Sam Smith\"},{\"id\":2,\"UserName\":\"Fred Frankly\"}]" }
How can i handle this?