Gossamer Forum
Home : General : Perl Programming :

Adding records to a Database

Quote Reply
Adding records to a Database
Question:

I have an account with Pair (pair.com). They offer MySQL and mSQL (along with PHP) as account add-ons.

Is there a way for me to automatically add records (without human intervention) to a database on their server from my PC (windows)?

I have a program constantly running on my computer doing some calculations. Whenever it generates a specific result (hundreds each day), I would like them to appear on my website.

Can this be done automatically through some sort of program, or Perl script (I have ActivePerl installed on my PC), etc?

Thanks for any tips.

[This message has been edited by Andrew N (edited May 09, 1999).]
Quote Reply
Re: Adding records to a Database In reply to
Couple ways you could go. The easiest way is if they allow access to your mysql database from your machine via port 3306. Then you can just insert information directly using ODBC or the mysql client. For instance you could run SQL statements by doing:

type sql.txt | mysql -hwww.myserver.com -umyusername -pmypass

and it would run all the sql commands in sql.txt. You could also use perl to do the job to.

Ask your ISP if they provide access to Mysql from remote machines.

Alternatively, you could write a cgi script on your webserver to do the insert, as well as a script on your local machine to call the cgi script. A bit more complex, but doable.

Cheers,

Alex