Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API to pass a record from foxpro cpanel mysql table

Status
Not open for further replies.

MSiddeek

Programmer
Apr 14, 2019
15
LK
Dear Experts,

Is there any methods(API) which pass/push/update a cpanel MySQL table a record from FoxPro
ie; when updating FoxPro form it is to send the record to a specific website's cpanel MySQL table.

Regards
MSiddeek.
 
MSideek,

What specific cPanel API function do you want to call? WinHTTP.WinHTTPRequest or MSXML2.ServerXMLHTTP COM classes can be used to execute the call, and JSON libraries like nfJSON @ VFPX to help you parse the result.

If you want to perform CRUD operations on a MySQL database that you normally access via a cPanel installation, then the MySQL server must be accessible through an IP port to which you can set an ODBC connection.
 
I second what Antonia (atlopes) said,

just, when the MySQL database allows remote connection you cannot only use some CRUD Rest API calls via HTTP, you can simply use SQL via an ODBC connection.

I haven't worked with Cpanel, as far as I know it's less than direct access to some webserver but more than FTP. If you can get to the MySQL console via cpanel you may be able to grant access to some user from anywhere or just a specific IP. Your hoster should have a FAQ about such things. It depends on how much control you have. If the MySQL Server is shared among several hosting customers, you likely can't change this, even with root access, as the MySQL service itself may be bound to IP address 127.0.0.1 (localhost).

So anything the MySQL Server executes has to come from localhost. Then you're in the situation you need a REST API. That's not part of MySQL itself, though. So you may need to look into options to establish such an API, which does SQL on the server-side and is used by HTTP Requests from the client-side.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top