Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
How to insert into MYSQL from Javascript library

This is my current project using Javascript library, BalkanApp

The Add button is from library

This is the coding from the template

        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" }
        }           
  });

This is the details I need to INSERT into 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"}

];

And this is what I have done for now

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();
?>
});

I found the explanation of the library here but still cannot find the solution https://balkan.app/OrgChartJS/Docs/Menus https://balkan.app/OrgChartJS/Docs/APIReference#addEvent

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!