安卓用php连接mysql数据库,连接到MySQL数据库使用PHP从Android设备

I am trying to connect to MySQL using PHP from an Android Device. I am following this tutorial: http://blog.sptechnolab.com/2011/02/10/android/android-connecting-to-mysql-using-php/

My question is where does the php file go that you create? Is that included in your Android Project or where do i run it from?

Thanks

解决方案

To answer your questions:

1) The php file is not included on the Android device.

2) You need to create the .php file and upload it to a server.

Now, I'm not sure how much you know about php, but just in case you are a beginner, you can easily create .php files using a text editor application such as Text Edit (Mac) or Notepad (Windows). Do you control a server or have a website somewhere? If so, you can upload the file to a location there.

How the php file will work:

First, your android device (once your finish that tutorial you cited) will send a request to the php file on your server, and the php file will then connect to the MySQL database, and generate some output which your Android app can get back (ex. to know the result of the MySQL connection attempt, etc)

*Going Further

If you want a super-easy tutorial on php check out W3 Schools excellent php section: http://www.w3schools.com/php/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值