I have a table created from a JSON string and am struggling to get at the information in it. I have read quite a few table tutorials but none seem to go deep enough.
Here is my JSON string -
{“results”:[{“offerDesc”:“30% off at whatever restaurant in town”,“offerURL”:“www. restaurant.com”},{“offerDesc”:“A bargain in liverpool”,“offerURL”:“www.anotherurl.co.uk”}]}
To get it into my table am using -
for k,v in pairs(response) do offers[k] = v end
But then if I go around myTable using pairs and printing the results to terminal am getting ‘table: 0x10b4c8770’
Ideally I would want to access myTable.offers like this -
offers[1].offerDesc
offers[2].offerDesc
Any ideas ?
Dave