How to send a SQL query to database in PHP without waiting for result

前端 未结 3 679
小鲜肉
小鲜肉 2021-01-27 08:20

Working with DB2 and PHP, my ADDs and DROPs take a long time to finish (30 seconds per ADD and DROP). I am curious if there is a way to send my ADDs and DROPs to the database w

3条回答
  •  面向向阳花
    2021-01-27 08:47

    You could code up a "standalone" php script and fire it off using a "system" call.

    You only problem would how to pass the data to the script. I would recommend you create an intermediate "actions" table where you can instert the desired updates and have the batch script read the actions and apply the updates.

    If you have DB2 installed you may have MQ installed as well. If you do, you can look at a solution where you push your update requests into an MQ queue and have them actioned by a triggered program.

提交回复
热议问题