Jay,
now before you go through all the discussion, here are the main points about your problem. To summarize what you told about your situation, let me quote you:
Jay9988 said:
1. The company has also a website with mysql database hosted on the internet.
2. I want to add a feature to my foxpro application, to send data from desktop database to the database hosted on the internet.
3. Any practical suggestion for this matter or link of sources which I can learn ?
4. I have search about cURL, REST API -> is it relevant?
5. I have use mysql and VFP for develop desktop in LAN Environment.
6. Could we use Sqlstringconnect to access the remote database? and use SQLEXEC to insert, update, or delete?
7. As far as i know, mostly the database server/ web server will reject direct sql statements, am I right?
Even though most of this has already been answered, let me give you a summary answer in order of most relevance:
5. As you have an application using a MySQL backend in VFP, all you need to do is change the connection string to connect to the MySQL database in the internet you mention in point 1 and 2.
6. yes
4. no
7. no, today it's more common hosted databases allow remote connections.
2. That's done by changing the Server= part of the connection string, connecton object or DSN your application mentioned in point 5 uses. An ODBC driver cannot only connect to a local/LAN MySQL databse, but also to a database hosted in the internet.
1. Fine, but that's very low information. You should know more details about it. When the contact you have is not a technical person, you need to make contact with their administrator, web administrator, web designer, who ever knows enough about their hosting to give you the essential information you need.
3. Because of 5 you actually only were missing the information I gave in the answer to point 2, a change of the connection strings Server parameter. There might be more changes needed, if the LAN database you programmed for differs in its version from their hosted database, you may also need another driver and change the Driver= part of the connection string, too.
If you want to learn much more, there are even some books for MySQL with VFP from Hentzenwerke, you can find that with google:
But again, if you already have an application using a MySQL database, there's nothing new to learn but the simple fact, that the Server=xyz cannnot only be a xyz server name of a LAN but also a domain name or (static) IP adress or something else.
The challenges you might face is that the personal contact you have at your customer has no technical knowledge about their hosting, so that requires a bit fighting through to get in touch with the right person. It's not the only challenge, because a database server they have available as a feature on their site is fine, but will surely not have the data of your application from the LAN, so that needs to move there, which again requires the technical informations necessary to address that database. After you have that, the topic of database synchronization Mike Gagnon posted in the first answer could be helpful, though it is about MS SQL Server and not MySQL.
You'll still be waiting for a sample code you can copy&paste and have a first runnable example of a MySQL connection with a database hosted somewhere not on LAN. Well, you find sites like SQLFiddle allowing you to experiment with online databses, but they won't hand out credentials and server IP addresses or domains which run these databases, because any such concrete connection information is an invitation for hackers. If you really want to experiment and confirm that all you already have continues to work once a MySQL server is in the internet, you find tons of hosters you could try out for free for a limited period, most of the time, or that only cast $1 a month or even host a mysql database for free at some sites, which pop up and vanish again, but could be used just for experimenting. Something like
they host databases on subdomains like sqlN.freemysqlhosting.net with a user and password you get or specify in an account you create amd then you could start seeing that all you did in your application also works with a datbase in the internet.
I already addressed the case that some hoster doesn't allow remote connections. It's a sign of a bad oster incapable to have a security hardened MySQL server, one sure sign of that is their local only databases allow you to connect with the root user, the super user/admin of any MySQL database, any decent hoster will allow you to have a user that already has limited priviledges to start with, so you can't even grant too much rights accidentally. If you need all options and they want all rights, then they also should have a technically knowledgable person and at least host their own virtual server, if not colocate server hardware at a datacenter of a hoster.
Security concerns? You can make secure connections requiring certificates on both server and client side, so in short ensuring that only the appplication they want to acesss their databse is possible, it's a feature of ODBC/MySQL and it's the way to connect I'd recommend to use.
Chriss