mysql教程触发器数据库教程同步数据方法
function res(){
document.getElementById("tab2").value = "pre_"+document.getElementById("tab1").value;
}
";
`$meta->name`=NEW.$meta->name,
";
`$meta->name`=NEW.$meta->name;
// -----------------------------------------------------------------
$result = mysql_query("select * from $tab1")
or die("Query failed: " . mysql_error());
$i = 1;
if ($i < mysql_num_fields($result)){
$meta = mysql_fetch_field($result);
// -----------------------------------------------------------------
/**
* create trigger `tri_del` BEFORE DELETE on `aaa`
* for each row BEGIN
* DELETE FROM bbb WHERE id =OLD.id;
*/
echo("
");
echo "create trigger " . $tab1 . "_del BEFORE DELETE on $tab1
";
echo "for each row BEGIN
";
echo "DELETE FROM $tab2 WHERE $meta->name =OLD.$meta->name;
";
echo("END;");
}
// -----------------------------------------------------------------
echo("
");
/**
* create trigger `up_date` BEFORE UPDATE on `aaa`
* for each row BEGIN
* UPDATE bbb set a1 = new.a1 , a2=new.a2 where id = new.id;
* END;
*/
$result = mysql_query("select * from $tab1")
or die("Query failed: " . mysql_error());
/**
* get column metadata
*/
$i = 1;
echo "create trigger " . $tab1 . "_update BEFORE UPDATE on $tab1
";
echo "for each row BEGIN
";
echo "UPDATE $tab2 SET
";
while ($i < mysql_num_fields($result)){
$meta = mysql_fetch_field($result);
if (!$meta){
echo "No information available
n";
}
echo "
";
`$meta->name`=NEW.$meta->name,
";
`$meta->name`=NEW.$meta->name
我的博物馆故事 官方安卓版v1.61.2
我的博物馆故事是一款以消除为主题的经营养成类手游,在这里玩家
专业模拟飞行10 手机版v12.2.4
专业模拟飞行10安卓版是一款飞行休闲手游,顶尖的物理飞行引擎
动物起义战斗模拟器二琳同款 最新版v4.1.1
动物起义战斗模拟器是一个非常有趣的模拟类游戏,玩家可以召唤各
迷你世界七周年 安卓手机版v1.43.0
迷你世界7周年是一款由《迷你世界》官方推出的庆祝特别版本,在
劫后公司无限资源版 v1.0.5.1
劫后公司内置菜单版是游戏的破解版本,在该版本中为玩家提供了内