I'm wondering how to count the number of rows in the database I'm
creating from a C program.  The database has a row number or Id that
is the primary key.  I need to know how many rows there are to know the
next row number so I can add more temperatures to the database.  I'm
developing on a Raspberry Pi 3 Model B 2016.  I have six USB
temperature sensors hooked up that I read from in a loop.  I generate a
timestamp using time.h and step through the six sensors.  Each sensor
has an internal temperature and an external temperature.

Table is like so:

id, sensor, timestamp, temp_inner, temp_outer.

With data types:

Integer, Integer, Integer, float, float.

If I can't get a row count in the C program, I have to pass it in every
time I do another round of readings.  I'm using sqlite3.h for database
access and manipulation.

I've been trying to answer this question on my own, but finding sample
C code that does this is not proving to be easy.
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to