javascript - 如何从 Javascript 库插入 MYSQL
问题描述
这是我当前使用 Javascript 库 BalkanApp 的项目
这是模板中的编码
template: "ula",
nodeBinding: {
field_0: "name",
field_1: "title",
img_0: "img"
},
nodeMenu: {
details: { text: "Details" },
edit: { text: "Edit" },
add: { text: "Add" },
remove: { text: "Remove" }
}
});
这是我需要插入 MYSQL 的详细信息
nodes = [
{ id: 3, pid: 1, tags: ["blue"], ppid: 2, name: "Queen Elizabeth II", img: "https://cdn.balkan.app/shared/f5.png"},
{ id: 4, pid: 3, tags: ["left-partner"], name: "Prince Philip", title: "Duke of Edinburgh", img: "https://cdn.balkan.app/shared/f3.png"}
];
这就是我现在所做的
chart.on('add', function (sender, node) {
<?php
$sql = "INSERT INTO individual (id, pid, ppid, tags, name, title, img)
VALUES ('node.id', 'node.pid', 'node.ppid', 'node.tags', 'node.name', 'node.title', 'node.img')";
if ($mysqli->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
});
我在这里找到了库的解释,但仍然找不到解决方案 https://balkan.app/OrgChartJS/Docs/Menus https://balkan.app/OrgChartJS/Docs/APIReference#addEvent
解决方案
推荐阅读
- angular - 我们是否需要为实时/生产部署提供带有角度构建文件的 ssl 证书文件?
- python - 为什么连字符(-)在 python 字符串中表现特别?
- jenkins - 从管道获取 Jenkinsfile 路径?
- android - Ellipsize 不再起作用 - Android
- codenameone - html 视频控件在 Android 的 codenameone 应用程序中不起作用
- javascript - 如何解决未定义的索引:PHP 中的 stripeToken?
- css - 无法在 iPad 和 iPhone 的输入字段中查看整个文本
- apache - Apache 2 位置块
- scala - Flink WindowFunction 折叠
- xpath - Xpath 多重格式化输出