0

I have made a phonegap app and i want to know how to connect it to the database in my hosting website and add data?

Anubhav Marwaha
  • 19
  • 1
  • 1
  • 5

2 Answers2

0

Activate Internet permission and then use an AJAX like function to call a WEB API. This could be a script hosted from your hosting company which when called returns the data which you require in your app. This should ideally be in a standard format like JSON or XML.

Read more about REST APIs.

Read this to learn about REStfull APIs and Services.

See this post from 2011 which pulls a REST API.

Iceman
  • 6,035
  • 2
  • 23
  • 34
0

API / Web Service is a code which can be written in any server side language like PHP. This script will communicate with with your Database.

These API/ Web service can be called from client, client can be a Web App / Web Site/ Mobile app, using HTTP METHODS (POST, GET etc). This API request will give response to the particular client with expected result (i.e. fetching data from database etc) and the response format can be JSON/ XML.

For more information you can Refer.

Community
  • 1
  • 1
AkshayP
  • 2,141
  • 2
  • 18
  • 27