FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Retrieving hosted MySql/MariaDB data using api
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Retrieving hosted MySql/MariaDB data using api
Posted: Fri Jun 21, 2019 03:58 AM

A hosting company I'm using provide MySql database but doesn't opened it to world so I can't use FWCONNECT.

They suggest I create a script to act as an api to communicate with the server.

Anyone has done something similar? The script would need to cover the usual stuffs; adding, editing record, make enquiry

TIA

FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Retrieving hosted MySql/MariaDB data using api
Posted: Fri Jun 21, 2019 04:05 AM
  1. You can have a php script on your hosted server.
  2. You will be calling this php script from your Fivevin application
  3. This php script will accept parameters from your Fivewin application which will be your SQL queries or Data manipulation commands
  4. This php script will return the resulting recordset as JSON
  5. The JSON data received from the hosted server will be processed in your fivewin application
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Retrieving hosted MySql/MariaDB data using api
Posted: Fri Jun 21, 2019 04:18 AM

Thanks for the quick reply Anserk. Now I have a starting point

If anyone else has some useful links, pointers especially code snippets to share they are welcomed and I thank you in advance

The database in question need not even be a MySql database but simple dbfs

FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour

Continue the discussion