0

I am a student and I am creating android app using apache cordova. I want to access MySql Database of hosted website using apache cordova. Please suggest me how can I do it.

Thanks in advance

Ajay Dude
  • 29
  • 5
  • 1
    You want the data or really need to connect to the 3306 port of MySQL using MySQL's own protocol? Sure the former and you are suggested to have a server which talks with your App using HTTP and query your MySQL server. – Ken Cheung Apr 29 '16 at 08:02
  • I want to retrieve data from MySql – Ajay Dude Apr 29 '16 at 08:19
  • Don't do that. MySQL is not a very secure protocol, plus you would have to hard-code mySQL user data in your app that anyone could get from there. You need to have something in between. I've heard there's pre-made scripts for these kinds of scenarios, though. – Pekka Apr 29 '16 at 08:21

1 Answers1

0

For accessing that DB, you need to make a server API, you dont have to make it in PHP, there are a lot of technologies, but you can't do it directly from the client side (cordova).

Google for API REST or web service and choose your technology.

Gandhi
  • 11,875
  • 4
  • 39
  • 63
Víctor
  • 3,029
  • 3
  • 28
  • 43