Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

139
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda