如何从我的日历中获取开始日期和结束日期以将其插入我的数据库

So I'm using codeigniter 3. I am asking for how can I get start and end date from my calendar to insert it to my database. This is my js code:

 CalendarApp.prototype.onSelect = function (start, end, allDay) {
    var $this = this;
        $this.$modal.modal({
            backdrop: 'static'
        });
        var form = $("<form action='http://localhost/somokos/profile/calendrier/somokos/create_event' enctype='multipart/form-data' method='post' accept-charset='utf-8'></form>");
        form.append("<div class='row'></div>");
        form.find(".row")
            .append("<div class='col-md-6'><div class='form-group'><label class='control-label'>Event Name</label><input class='form-control' placeholder='Insert Event Name' type='text' name='title'/></div></div>") 
            .append("<div class='col-md-6'><div class='form-group'><label class='control-label'>Category</label><select class='form-control' name='color'></select></div></div>")
            .find("select[name='color']")
            .append("<option value='bg-danger'>Danger</option>")
            .append("<option value='bg-success'>Success</option>")
            .append("<option value='bg-purple'>Purple</option>")
            .append("<option value='bg-primary'>Primary</option>")
            .append("<option value='bg-pink'>Pink</option>")
            .append("<option value='bg-info'>Info</option>")
            .append("<option value='bg-warning'>Warning</option></div></div>");
        $this.$modal.find('.delete-event').hide().end().find('.save-event').show().end().find('.modal-body').empty().prepend(form).end().find('.save-event').unbind('click').click(function () {
            form.submit();
        });
        $this.$modal.find('form').on('submit', function () {
            var title = form.find("input[name='title']").val();
            var beginning = form.find("input[name='beginning']").val();
            var ending = form.find("input[name='ending']").val();
            var categoryClass = form.find("select[name='color'] option:checked").val();
            if (title !== null && title.length != 0 && beginning != 'beginning' && ending != 'ending') {
                $this.$calendarObj.fullCalendar('renderEvent', {
                    title: title,
                    start:start,
                    end: end,
                    allDay: false,
                    className: categoryClass
                }, true); 
                $this.$modal.modal('hide');
                return  ;
            }
            else{
                alert('You have to give a title to your event');
            }
            return false;

        });
        $this.$calendarObj.fullCalendar('unselect');
},

I get this error when I pass it to PHP. MySQL Error

Thank you guys I got it. I added to my js code

$('#lab1').val(start);

and to my html

<input type='text'  id='lab1'/>

and it works thanks again