i'll want understand a think.
I configure inside motion.conf my first and unique webcam; i run motion and during motion detect the program insert inside mysql database some information.
I use this query inside motion.conf:
sql_query insert into rm_events(camera, filename, frame, file_type, text_event) values('%t', '%f', '%q', '%n', '%C')

I see inside the table "camera" of my db..the value "1"..it's the numer of thread (%t) but..i don't understand..the camera values are inside motion.conf and i think the camera is thread0..
Infact, if i open the HTTP Control of motion i see this:

Motion 3.2.12 Running [1] Threads
The problem is..inside http Control.. there the thread is number 0.. but with mysql function of motion the thread value is store as 1..
Why? It's right? Or there is something wrong?
With a little php script i use get function of http control for recover the Camera name (text_left); i recover the camera thread from mysql db and i create the url for http control for recover the parameter...