Windows App to MySql table

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have a C++ Builder APP that uses the Advantage database.  I want to export
data from the Advantage tables to a MySQL database on my website.

What is the best way to get my data into the MySQL table ?  I am only
looking at 10-15 records, but I would be updating every 10 seconds or so.

I could create a text file and upload it via FTP, and then a PHP script
could load the text file into MySQL, but I am sure you guys know a better
way to do it.


Re: Windows App to MySql table

Douglas Hay wrote:

Quoted text here. Click to load it

Well if you are sure that you have only small amount of data, you could
send the data as a POST or GET parameters to your PHP script. You can
also upload a file directly to PHP script, which is pretty simple to do
manually, but requires usually some knowledge of http headers if you
want to do that from a program.

You can also directly connect to remote MySQL server, if the server is
configured to allow that.

You could also use secure file transfer protocol instead of FTP and
disable the security risk that comes with FTP.

Re: Windows App to MySql table

I need to send the data every 10 seconds or so, so I was afraid to send the
data through a browser as PHP parameters because it would be slow.

I will try to find some info on Secure FTP.  Thanks,


Quoted text here. Click to load it

Re: Windows App to MySql table

Douglas Hay wrote:
Quoted text here. Click to load it

If you need it to be fast, then connect directly to the MySQL server and
insert the data there. Every other way will be slower, unless the amount
of data is so large or network connection so slow that you get speed
increase by packing the data before transfer and unpacking it at the server.

If you won't use any data packing, then secure file transfer won't be
any faster than sending the data directly to a PHP script.

How you should do this, depends very much on what you can do. For
example if you are allowed only to listen port 80 at the server side,
then you can't connect directly to MySQL and you can't use SSH or FTP

And I really hope that you didn't plan to start a web browser like
Firefox or IE to send the data? That would be slow. There are other ways
to send data to PHP scripts, depending on the programming language you
are using.

Re: Windows App to MySql table

I know a browser would be horribly slow!  I am using C++ Builder.  I have
tried uploading a .TXT file to the site, and then a PHP script displays it
every 10 seconds.  It works but it isn't ideal.  Can you suggest a way to
get data to a PHP script without using a browser ?  I don't have to have it
store into the MySQL database at this time.


Quoted text here. Click to load it

Re: Windows App to MySql table

Douglas Hay wrote:
Quoted text here. Click to load it

Well basicly you need to write a small part of a normal browser in your
program, which should simulate normal HTTP POST by calling the php
script with parameters, where you would store the information you need
to transfer. If you have a large amount of parameters, you need to
simulate file upload.

Making a software with php that allows you to manually upload files is
pretty simple, see this page for examples and info:

Writing the C++ side could be triggier, unless you have a good library
functions to do the most of your work. You need to find information how
to use commit HTTP POST from your application and how you need to modify
the headers to be able to send file within the POST.

Anyway, since this doesn't have anything to do with MySQL this is
propably wrong group for this subject, and I'm not the best person to
tell you how to do it. Propably they know better in a group where you
can ask questions about how to program using your compiler.

(Don't try asking in comp.lang.c++ or comp.lang.learn.c-c++ since they
allow only questions about standard C++ and you can't do this with
standard C++)

Site Timeline