How to insert values from JQuery datepicker to MySQL date datatype using Codeigniter?

后端 未结 5 883
一整个雨季
一整个雨季 2021-02-09 18:19

i can\'t insert the values from my JQuery Datepicker to my MySQL database with Date datatype. how will i convert string to date datatype? im using Codeigniter with MVC. here\'s

5条回答
  •  独厮守ぢ
    2021-02-09 18:51

    $(document).ready(function() {
    
        var year=new Date().getFullYear();
        var yearTo=year-18;
        var yearFrom=year-100;
    
        //display the years from hundred years in the past till 18 years in the past
    
        $( "#datePickerDOB" ).live("click",function(){      
    
            $( "#datePickerDOB" ).datepicker({
                changeMonth: true,
                changeYear: true,
                yearRange: yearFrom+":"+yearTo,
                dateFormat: "dd-mm-yy"
            });
        });
    });
    

提交回复
热议问题