简体   繁体   English

将Web应用连接到mysql数据库

[英]Connect web app to mysql database

I have a web application on Android and iOS which uses html and javascript for the project. 我在Android和iOS上有一个Web应用程序,该项目使用html和javascript。 I now have local values and app works fine. 我现在有了本地值,应用程序运行正常。 now I want to use a mysql database for my inputs, are there any good tutorial or sample codes on how to do that. 现在,我想使用mysql数据库作为输入,是否有任何好的教程或示例代码来说明这一点。 I'll appreciate if you can help me with this. 如果您能帮助我,我将不胜感激。 Thanks 谢谢

You need to choose a language that will operate server side to manage the database of your web app, eg you could use PHP as a language and MYSQL as a database software (it's free and awesome), for examples you could use http://php.net/ and search how to use specific mysql commands in PHP, or use a framework like CodeIgniter which has built in functions for database management and you can view some of them here https://ellislab.com/codeigniter/user-guide/database/active_record.html , but make sure you use the whole user guide on how to use it and how to set up your database configuration properly! 您需要选择一种将在服务器端运行的语言来管理您的Web应用程序数据库,例如,您可以使用PHP作为一种语言,并使用MYSQL作为一种数据库软件(它既免费又很棒),例如,您可以使用http:// php.net/,并搜索如何在PHP中使用特定的mysql命令,或使用诸如CodeIgniter之类的框架,该框架具有用于数据库管理的内置功能,您可以在此处查看其中的一些https://ellislab.com/codeigniter/用户指南/database/active_record.html ,但是请确保使用完整的用户指南,以了解如何使用它以及如何正确设置数据库配置!

EDIT. 编辑。 If you don't want to use PHP for the actual app then you can use it server side, ie use it as part of a server file which connect to database, handle data, send it back, then send it back to your remote app where you can handle it with Javascript. 如果您不想在实际的应用程序中使用PHP,则可以在服务器端使用它,即,将其用作服务器文件的一部分,该文件连接到数据库,处理数据,将其发送回去,然后将其发送回您的远程应用程序您可以在其中使用Javascript处理它。

对于Web应用程序和mysql通信,需要像php这样的脚本语言,对于数据库,您需要像mysql这样的数据库,这里有关于mysql连接的简单教程http://www.androidhive.info/2013/12/android-populating-spinner-data-从mysql数据库/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM