Page 1 of 1

Help with MySQL

Posted: Sat Nov 16, 2013 5:32 pm
by pjsamson
I am new to this system and am trying to set up MySQL. Doe anyone have an example MySQL query that illustrates how to store a timestamp as well as the data? I am trying

Code: Select all

"insert into data (datetime,temp) values ([YYYY]-[MM]-[DD] [hh]:[mm]:[ss],[th0temp-act.1:-9999])"
but this doesn't work and the documentation is a tad sparse.

Thanks

Re: Help with MySQL

Posted: Sat Nov 16, 2013 6:30 pm
by pjsamson
Never mind, I found a solution for inserting datetime (use now(), ...duh). For others setting up a MySQL push with MeteoBridge here's the working query I've created:

Code: Select all

insert into data (datetime, temp, hum,dew,heat_index, in_temp,in_hum,in_dew,press,sea_press,wind,avgwind,winddir,windchill,rainrate,raintotal,uvindex,solarrad) values (now(),[th0temp-act.1:-9999],[th0hum-act.0:-999],[th0dew-act.1:-999],[th0heatindex-act=F.1:-999],[thb0temp-act=F.1:-999],[thb0hum-act.0:-999],[thb0dew-act=F.1:-999],[thb0press-act.1:-999],[thb0seapress-act.1:-999],[wind0wind-act=mph.1:-999],[wind0avgwind-act=mph.1:-999],[wind0dir-act.0:-999],[wind0chill-act=F.1:-999],[rain0rate-act=in.2:-999],[rain0total-act.2:-999],[uv0index-act.1:-999],[sol0rad-act.1:-999])
Hope that helps.