<bdo id='QcAi8'></bdo><ul id='QcAi8'></ul>

  • <tfoot id='QcAi8'></tfoot>

    <small id='QcAi8'></small><noframes id='QcAi8'>

    <legend id='QcAi8'><style id='QcAi8'><dir id='QcAi8'><q id='QcAi8'></q></dir></style></legend>

      1. <i id='QcAi8'><tr id='QcAi8'><dt id='QcAi8'><q id='QcAi8'><span id='QcAi8'><b id='QcAi8'><form id='QcAi8'><ins id='QcAi8'></ins><ul id='QcAi8'></ul><sub id='QcAi8'></sub></form><legend id='QcAi8'></legend><bdo id='QcAi8'><pre id='QcAi8'><center id='QcAi8'></center></pre></bdo></b><th id='QcAi8'></th></span></q></dt></tr></i><div id='QcAi8'><tfoot id='QcAi8'></tfoot><dl id='QcAi8'><fieldset id='QcAi8'></fieldset></dl></div>
      2. 插入表后在mysql触发器中发送http请求

        Send an http request in mysql trigger after insertion in a table(插入表后在mysql触发器中发送http请求)
        <i id='dgEAL'><tr id='dgEAL'><dt id='dgEAL'><q id='dgEAL'><span id='dgEAL'><b id='dgEAL'><form id='dgEAL'><ins id='dgEAL'></ins><ul id='dgEAL'></ul><sub id='dgEAL'></sub></form><legend id='dgEAL'></legend><bdo id='dgEAL'><pre id='dgEAL'><center id='dgEAL'></center></pre></bdo></b><th id='dgEAL'></th></span></q></dt></tr></i><div id='dgEAL'><tfoot id='dgEAL'></tfoot><dl id='dgEAL'><fieldset id='dgEAL'></fieldset></dl></div>

              <tbody id='dgEAL'></tbody>

              • <bdo id='dgEAL'></bdo><ul id='dgEAL'></ul>
              • <legend id='dgEAL'><style id='dgEAL'><dir id='dgEAL'><q id='dgEAL'></q></dir></style></legend>

                <small id='dgEAL'></small><noframes id='dgEAL'>

                1. <tfoot id='dgEAL'></tfoot>
                2. 本文介绍了插入表后在mysql触发器中发送http请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 PHP 中工作.我必须创建一个 mysql 触发器,它会在插入表后触发 http 请求.下面是代码.

                  I am working in PHP.I have to created a mysql trigger which fires an http request after insertion on table.Below is the code.

                  DELIMITER @@
                  CREATE TRIGGER Test_Trigger
                  AFTER INSERT ON insertsms
                  FOR EACH ROW
                  BEGIN
                    SET @tt_json = (SELECT json_object(id,addtime,title) 
                                    FROM insertsms WHERE id = NEW.id LIMIT 1);
                    SET @tt_resu = (SELECT http_put(CONCAT('--url localhost--')));
                  END;
                  @@
                  DELIMITER ;
                  

                  但我收到类似的错误

                  消息:SQLSTATE[42000]:语法错误或访问冲突:1305 FUNCTION emg.json_object 不存在

                  Message: SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION emg.json_object does not exist

                  消息:SQLSTATE[42000]:语法错误或访问冲突:1305 FUNCTION emg.http_put 不存在

                  Message: SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION emg.http_put does not exist

                  如何消除这个错误?我无法下载包含这些功能的支持文件.我已经在 localhost 中进行了测试.还有其他方法可以满足我的要求吗?请任何人帮助我..

                  How to remove this error? I was not able to download the supporting files containing these functions.I have tested in localhost.Is there any other way to achieve my requirement? Please anyone help me..

                  推荐答案

                  虽然技术上可行,但出于以下几个原因,我强烈建议您不要走这条路:

                  Although it's technically possible I'd strongly discourage you from going this route for several reasons:

                  1. 使用 UDF 本身就是一种安全风险.UDF 可供所有数据库用户使用 - 您不能为其授予 EXECUTE 权限.

                  1. Using UDFs is a security risk on its own. UDFs are available to all database users - you cannot grant EXECUTE privileges for them.

                  在触发器中执行任何非事务性操作完全是错误的.DML 语句所做的数据更改(在您的情况下是更新)可以并且将在现实世界中回滚.您将无法撤消 http 调用.

                  Doing any non-transactional operations in a trigger is simply wrong. Data changes made by DML statement (in your case it's an update) can and will be rolled back in a real world scenario. You won't be able to undo your http calls.

                  您延长了插入事务的时间,可能会导致其他更新/插入操作的锁定等待超时.

                  You're prolonging the time for insert transaction possibly causing lock-wait-timeouts for other update/insert operations.

                  强烈推荐阅读:

                  • 触发器的问题

                  现在很可能你需要的是一个工作队列,例如beanstalked.使用这种专门的中间件比用数据库组织队列要好得多.

                  Now most likely what you need is a work queue e.g. beanstalked. Using such specialized middleware is much better than organizing queues with database.

                  这篇关于插入表后在mysql触发器中发送http请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <bdo id='SuO0c'></bdo><ul id='SuO0c'></ul>
                      <tbody id='SuO0c'></tbody>

                          <i id='SuO0c'><tr id='SuO0c'><dt id='SuO0c'><q id='SuO0c'><span id='SuO0c'><b id='SuO0c'><form id='SuO0c'><ins id='SuO0c'></ins><ul id='SuO0c'></ul><sub id='SuO0c'></sub></form><legend id='SuO0c'></legend><bdo id='SuO0c'><pre id='SuO0c'><center id='SuO0c'></center></pre></bdo></b><th id='SuO0c'></th></span></q></dt></tr></i><div id='SuO0c'><tfoot id='SuO0c'></tfoot><dl id='SuO0c'><fieldset id='SuO0c'></fieldset></dl></div>
                            <legend id='SuO0c'><style id='SuO0c'><dir id='SuO0c'><q id='SuO0c'></q></dir></style></legend>
                          • <small id='SuO0c'></small><noframes id='SuO0c'>

                          • <tfoot id='SuO0c'></tfoot>