Please tell me how to connect mysql with php in kotlin


#1

hi i would like to thanks for kotlin but i still want to know how can i connect mysql with php in kotlin , please i don’t want suggestion i want example with code or vids

best regards


#2

Sorry, I don’t understand what you’re trying to achieve. PHP is a programming language. Kotlin is a different programming language. If you need to connect PHP with MySQL, you don’t use Kotlin for that.


#3

Thank you for all but exactly how to connect mysql database on android
using kotlin


#4

MySQL does not run on Android. If you are looking to connect to a remote MySQL instance from Android, then this is a bad idea. You MUST NOT directly expose your database on the internet.

You need to write an API (JSON over HTTP/REST is the most popular way to do that at this moment) that the Kotlin app on Android will talk to. Since you mention PHP, I assume you will need to write the API in PHP.

Sorry, no code. Search for the following for plenty of tutorials and examples:

  • php mysql connection
  • php rest api
  • kotlin rest client