Reputation: 131
I am trying to make an app using phone gap that makes users login in. I know how to connect to a mysql database using php but I have no clue on how to connect to it using ajax. I hope someone could show how its done or if there is another way to connect to a mysql database in phonegap.
Thank You
Upvotes: 2
Views: 2306
Reputation: 19821
You can't directly connect to MySQL database from client side.. This is not exactly correct (but I've heard some people doing similar with MongoDB).
Anyway, right approach for this is:
Upvotes: 4
Reputation: 27119
This is not specific to Android.
Anyway, last time I checked, it wasn't possible to connect directly to MySQL via AJAX.
What you need is a back-end (in php, for example) that accepts connection via AJAX and then connects to MySql, processes the data and gives back the results via JSON, XML, plain text or whatever format you prefer.
Upvotes: 2