This is what I use to upload my variables to my database. This isn't the most secure way of doing it, your supposed to use ?'s instead of the variables then give the variables when you execute, but since this is running just on my computer and not on my internet root, I'm not too worried. But to be safe, the account I use has minimum rights. I'm not sure what version of MySQL I'm using, its the newest one. And this was my first bit into MySQL. Did a lot of Google searches in order to come up with this. You will need to install the DBI and DBI::MySQL modules using the perl package manager. Also, in the database you make, make a table called weather. Then in that table you need to make the following values named as such: date, tempOutdoor, tempIndoor, humidOutdoor, humidIndoor, windChill, windGust, windAvg, windAvgDir, rainTotal, rainRate, barom (This is assuming that you plan on using this for weather of course, tho I don't think that you ever specified if you were or not) As of right now, the rainTotal that it is uploading is the total rain since the last station restart. What I need to do yet is make something that compares the rainTotal from yesterday to the current rainTotal and the difference is the rain for today. Then at midnight, puts the current rainTotal into yesterday's rainTotal Like I said, this was my first time working with MySQL. Look at http://www.tizag.com/mysqlTutorial/ for lots of good info including how to make the database and the weather table. I had a lot of fun learning how to do this for the first time. Hope you do too.

Mick
------------------------ START CODE ------------------------ # Category=Weather #@ Loads the weather varriables to a MySQL database use DBI; use DBD::mysql; use Weather_Item; use weather_common; #definition of variables my $db="database name goes here"; my $host="host address goes here"; my $user="user name goes here"; my $password="password goes here"; my $uploadRate="4"; #how often to update the DB $v_update_weather_db = new Voice_Cmd('Update weather database'); #connect to MySQL database if ($state = said $v_update_weather_db || new_minute $uploadRate) { my $dbh = DBI->connect ("DBI:mysql:database=$db:host=$host", $user, $password) or die "Can't connect to database: $DBI::errstr\n";
#convert degrees into cardinal my $windAvgDir = convert_direction($Weather{WindAvgDir});
#upload to database $dbh->do("INSERT INTO weather (date, tempOutdoor, tempIndoor, humidOutdoor, humidIndoor, windChill, windGust, windAvg, windAvgDir, rainTotal, rainRate, barom) VALUES (NOW(), '$Weather{TempOutdoor}', '$Weather{TempIndoor}', '$Weather{HumidOutdoor}', '$Weather{HumidIndoor}', '$Weather{WindChill}', '$Weather{WindGustSpeed}', '$Weather{WindAvgSpeed}', '$windAvgDir', '$Weather{RainTotal}', '$Weather{RainRate}', '$Weather{Barom}')");
#disconnect from database $dbh->disconnect or warn "Disconnection error: $DBI::errstr\n"; }

------------------------ END CODE ------------------------


> From: Thomas Harding [mailto:thomasharding@myfairpoint.net] 
> To: The main list for the MisterHouse home automation program
> Subject: [mh] Other database options for MH?
>
>
>Mick, 
>
>I would appreciate if you did send me what you have, and also what version of Mysql you are using. 
>I am new to all this, so I am sure it will be a challenge for me. 
>
>thomasharding@... 
>
>Thanks, 
>
>Tom 

>
> From: bigmac_mc@hotmail.com
> To: misterhouse-users@lists.sourceforge.net
> Subject: RE: [mh] Other database options for MH?
> Date: Wed, 30 Dec 2009 12:23:36 -0600
>
> I use MySQL to hold a lot of my weather variable to pull up in various other
> places. You write from perl to MySQL using the DBT and DBI::MySQL modules.
> It's very easy to figure out. Lots of examples out there. If you're trying
> to get weather into a MySQL table I can shoot you the code I'm using. I've
> been looking at http://www.aditus.nu/jpgraph/ to use what's already in MySQL
> to make some nicer looking graphs than what rrd does. I haven't had time to
> get too far into it, so I have no idea what it takes to get it working.
>
> Mick
>
> -----Original Message-----
> From: Thomas Harding [mailto:thomasharding@myfairpoint.net]
> Sent: Tuesday, December 29, 2009 4:30 PM
> To: The main list for the MisterHouse home automation program
> Subject: [mh] Other database options for MH?
>
> I spent a considerable amount of time today installing RRD and trying to get
> rrds.ppd to install. I tried the latest version of Perl, RRD and rrds.ppd,
> but I get an error that rrds.ppd does not have support for this platform
> (when I try to install rrds.ppd, but everything else installed fine). I am
> running win XP Pro. I assumed it had something to do with RRD or perl, but
> now I think it is referring to the CPU. I am running a Via C7 1.5ghz CPU and
> windows and all software has installed and run fine, but I now think there
> is some CPU check for RRD that is not allowing rrds.ppd to install. I am new
> to RRD and installing PPMs, but I think I have done everything correctly. I
> just think it is a CPU check that is holding this up.
>
> Thanks for any info,
>
> Tom
> ----------------------------------------------------------------------------
> --
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> ________________________________________________________
> To unsubscribe from this list, go to:
> http://sourceforge.net/mail/?group_id=1365
>


Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. Sign up now.