问题
I am trying to develop a mobile app with HTML5, CSS and JavaScript in Eclipse Juno with IBM Worklight v6.
For the back-end if I want to use PHP files to connect to database, in which folder should that be included? After that will the database be connected to my Worklight project?
回答1:
It doesn't work that way.
Worklight projects do not support PHP.
If you want to connect to a database via your Worklight application, you need to use Worklight Adapters. Specifically, the SQL adapter:
- SQL adapter training module
- Associated sample project
Alternatively, you may place your PHP script on the same web server hosting the database (or however your network topology is...), and it will listen to incoming requests that you application will send to it using, again, Worklight Adapters. Specifically, the HTTP adapter:
- HTTP adapter training module
- Associated sample project
来源:https://stackoverflow.com/questions/22152633/ibm-worklight-6-0-how-to-include-a-php-file