是否可以将值从Mysql触发器传递给php? [英] Is it possible to pass a value to php from a Mysql trigger?

查看:83
本文介绍了是否可以将值从Mysql触发器传递给php?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用phpmyadmin,并且我有一个触发器,该触发器在向表中插入一些条目后执行,在该触发器中,我调用了一个php文件。但是我需要将值从触发器传递给php文件。如果是,那么建议我提供一些有关如何传递它的代码。(该值是表中插入的新值)。谢谢!

I am using phpmyadmin and i am having a trigger which executes after inserting some entries in a table,in that trigger i call a php file.But i need to pass a value to php file from trigger.. is it possible? if so suggest me some code for how to pass it.(the value is something a new value inserted in the table) Help Me.Thanks!

推荐答案

我不是phpmyadmin的专家,但可以说您用这样的触发器调用php文件:

I'm no expert with phpmyadmin but let's say you call your php file with the trigger like so:

dosomething.php

您可以通过 $ _ GET 像这样的变量:

You can pass $_GET variable like so:

dosomething.php?username=john

然后您可以在dosomething.php中访问此变量,如下所示:

You could then access this variable within the dosomething.php like so:

$username = $_GET['username'];

如果愿意


echo $ username;

echo $username;

它将返回 john

这篇关于是否可以将值从Mysql触发器传递给php?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆