Need help with moving data to mySQL database

Hello. I've been tinkering around with the Arduino for a while and am working on my first serious project.

I would like to store environmental sensor data collected by sensors attached to an arduino and transmitted via xbee in a mySQL database for later use. I can find good documentation and examples on everything except on perhaps the most critical part - taking data from the serial port of the always-on computer (Synology DS - linux) and inserting it into the mySQL db. I've managed to use php to talk to an arduino using the serial class but have so far not found any information about using php to move serial data from the arduino into the mySQL db despite spending many hours combing through forums, tutorials, etc.

Is php the best way to go and if so are there any examples out there?

I've also considered putting together a python script that reads from the serial port and inserts the data into the mySQL db. Would this be a workable solution and if so any idea if there are sample scripts avaiable to get me started?

Any and all comments are appeciated.

Thanks,

Baobab

So you're telling me you know how to use PHP, but you couldn't find this:

http://php.net/manual/en/book.mysql.php

...with a simple google search on "php mysql"? Huh?

:-?

Pehaps you should be find an app that can dump data from the serial port to a text file and then import that periodically into the DB?

@cr0sh

Thanks for the link. i haven't even started looking into writing the data into the db w/ php as I'm still stuck on trying to get it to read from the serial port and display what it is reading from said serial port on a web page. I figure if I can get it to do that, writing that data to a db should be straight forward as there is likely plenty of documentation out there on writing data to a db using php.

And no, I woldn't say that I know php. I have an understanding of what it could do for me and am trying to learn.

I've managed to use php to talk to an arduino using the serial class

i haven't even started looking into writing the data into the db w/ php as I'm still stuck on trying to get it to read from the serial port

So can you, or can you not, get php and the Arduino to communicate via the serial port?