hello everyone, i would like some help with sending data to thinger.io with esp32 in Arduino IDE.
I’m sending data from a database stored in esp32 memory, from sqlite3.
when fetching data from sqlite, I would like to send them together.E
example
[
{
“name”=“ruan”,
“age”=“33”
},
{
“name”=“david”,
“age”=“35”
}
]
part of the code:
thing[“Get3”] >> [](pson& out)
{
//“the database table is requested”
while (sqlite3_step(res) == SQLITE_ROW) { number of table line
int count = sqlite3_column_count(res);
for (i = 0; i<count; i++) { // count ~~>number of table columns
//for each column, the data corresponding to the table is added
colum = sqlite3_column_name(res, i);
resp = (const char *) sqlite3_column_text(res, i);
out[colum.c_str()] = resp.c_str();
}
}
the output result is only for the first row of the table
{
“name”=“ruan”,
“age”=“33”
}