Paul-DS / bootstrap-year-calendar

[DEPRECATED] A fully customizable year calendar widget, for boostrap !
Apache License 2.0
294 stars 243 forks source link

send datasources to database #233

Open josefequalizer opened 5 years ago

josefequalizer commented 5 years ago

hi, i make this code inside script to save datasource event in database but nothing happend no values in database :

$.ajax({ url:"insert.php", type:"POST", data:{id:event.id, name:event.name, startDate:event.startDate, endDate:event.endDate}, success:function(){ alert("Added Successfully"); } })
file insert.php: <?php

$connect = new PDO('mysql:host=localhost;dbname=recuperation', 'root', '');
$query = "INSERT INTO events (id, name, startDate, endDate) VALUES (:id, :name, :startDate, :endDate)";
$statement = $connect->prepare($query);
$statement->execute( array(':id'  => $_POST['event.id'], ':name'  => $_POST['event.name'], ':startDate' => $_POST['event.startDate'],':endDate' => $_POST['event.endDate']));

?>