There are a few things in your last chunk of code which will not work. There are also a few things I don’t understand with your code, however before I comment on that let’s get to the bottom of why your namesTable isn’t working the way you want.
(This will take a few postings back-and-forth, but eventually it’ll work)
Given the code you posted in post #16 above, your namesTable *should* have a ‘count’ table even when the SQL returns no rows. If you get a json object like {"names":[]}
, then something is going on.
if you add a print(json.encode(namesTable))
just before your savetable()
, does the output in the terminal from print() still give the same result without a ‘count’?
[import]uid: 70847 topic_id: 35342 reply_id: 142331[/import]