Q:

JavaScript/PHP: Get input from prompt and update the database

The title of the selected event needs to be changed to whatever is inputted at the prompt.
But it is not working as expected.Please suggest/advice
JavaScript function:
eventMouseover: function(event, domEvent) {
                var layer = '<div id="events-layer" class="fc-transparent" style="position:absolute; width:100%; height:100%; top:-1px; text-align:right; z-index:100"><a><img src="../../images/editbt.png" title="edit" width="14" id="edbut'+event.id+'" border="0" style="padding-right:3px; padding-top:2px;" /></a></div>';

                $("#edbut"+event.id).hide();
                $("#edbut"+event.id).fadeIn(300);
                $("#edbut"+event.id).click(function() {
                var title = prompt( '\n\nNew Event Title: ');
                if(title){
                $.ajax({
                url: '<?=base_url();?>testcalendar/fullcalendar/update_title.php',
                data: 'title='+ event.title+'&id='+ event.id ,
                type: "POST",
                });
                    }
                });
            }, 

PHP form (update_title.php):
<?php
$id = $_POST['id'];
$title = $_POST['title'];
// connection to the database
try {
$bdd = new PDO('mysql:host=localhost;dbname=blackboks-calendar', 'root', 'root');
 } catch(Exception $e) {
exit('Unable to connect to database.');
}
 // update the records
$sql = "UPDATE evenement SET title=". $title ."WHERE id=".$id;
$q = $bdd->prepare($sql);
$q->execute();
?>

A:

problem is when you sending the title. It should be title not event.title
change 
   data: 'title='+ event.title+'&id='+ event.id ,

to 
    data: 'title='+ title+'&id='+ event.id ,

