Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascritp

function Productos(){
    require_once("conexion.php");
    $data = file_get_contents("productos.json");
    $producto = json_decode($data, true);
    foreach($producto as $a){
        $consulta = $conn->prepare("Insert into productos values(?,?,?)");
        $consulta->bindParam(1,$a["codigo"]);
        $consulta->bindParam(2,$a["Nombre"]);
        $consulta->bindParam(3,$a["descripcion"]);
        $consulta->execute();
    }
}
Source by brianflove.com #
 
PREVIOUS NEXT
Tagged: #javascritp
ADD COMMENT
Topic
Name
8+7 =