dqlhsm9820 2012-04-24 16:56
浏览 32
已采纳

使用php将android连接到mysql数据库:多用户支持?

I am trying to develop an android application. In the application the user can search some data from the database that is on the server side. For that, I use a php script that is on the server side along with mysql database. I give it a call from the android app and the php code connects with the database and returns a json result which I decode and use it as I want.

My question is this. Can this support multiple users at the same time? For example 2 different users use at the same time the search function for retrieving data from the database. I know that the database itself can handle this kind of requests, but what about the php service?

Here is an example of the php code:

<?php
     mysql_connect("host","username","password");
     mysql_select_db("Deal");
     $sql=mysql_query("select * from CITY where CITY_NAME like 'A%'");

     while($row=mysql_fetch_assoc($sql))
       $output[]=$row;

     print(json_encode($output));
     mysql_close();
?>
  • 写回答

1条回答 默认 最新

  • doqp87012 2012-04-24 17:00
    关注

    PHP script is being launched by web-server environment. It's hard to imagine there exists web-server that doesn't support multi-threading at present. So, don't worry. The answer is positive.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘