raven77 Groupie
Joined: January 02 2007 Location: United States
Online Status: Offline Posts: 44
|
Posted: September 26 2010 at 15:27 | IP Logged
|
|
|
Hello,
Man posting on this forum is frustrating!!!
Sometimes when I hit enter it wipes out my post and decides to submit. I just had a huge message typed out...oh well
anyway...
I am trying to log temperature and furnace run time into a mysql database.
I can post to the database using php with no problems.
I can also update a GV using a timed event in PH using this code
"double(ph_rtne(ph_setvar_s(1,1,ph_getwburl("http://192.168. 1.15:85/gett1.cgi",10)) + ph_setvar_a(1,2,pos(ph_getvar_s(1,1),"<BODY>")) + ph_setvar_a(1,3,pos(ph_getvar_s(1,1),"</BODY>"))) + mid(ph_getvar_s(1,1),ph_getvar_n(1,2) + 6,ph_getvar_n(1,3) - ph_getvar_n(1,2) - 7))"
and that also works nice.
I just cant figure out how to post that data to the database hourly.
any ideas?
I would also like to log start and stop times of my furnace. the data url is about the same
"http://192.168.1.15:85/geti1.cgi"
But I am not sure the best way to log start/stop times to the database.
Best idea I came up with was to use a time event to poll the URL every 5 seconds and update a GV if it changes then use the GV trigger to post to the database.
But again, I am not sure how to insert to an external database with PH.
I realize this could probably be done outside of PH, but any help would be greatly appreciated.
Edited by raven77 - September 26 2010 at 15:43
|
MrGibbage Super User
Joined: October 23 2006 Location: United States
Online Status: Offline Posts: 513
|
Posted: September 27 2010 at 08:53 | IP Logged
|
|
|
I don't know if you can make a direct connection to a mysql database right from PH. If your mysql database
is hosted on some webserver that you have access to, I would write a small php program to take a url with
the post data being your entry into the database. Something like
mysupersecreturl.com?time=1600&date=9/27/2010&data1=1234&dat a2=sometext
By the way, I also have problems posting here from time to time. I've not had it delete an entire post, but
posting can take a looonnnnngggg time from the time I hit the "Post Reply" button.
__________________ Skip
|