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 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题