i need a function to convert a value taken from html input as date type to date in mysql database with php

this is for laragon server i used PDO function to connect with db this is php with mysql

function store($code,$libelle,$typecolis,$poid,$prixliv,$proprietaire,
                         $destinaire,$depart,$arrivee,$**dateprestation**,)
{
    v*ar_dump($dateprestation); // return **string(10) "2019-05-15"***

    $con= connecter();
    $pr =$con->prepare(
                        "insert into colis 
                 (code,libelle,typecolis,poid,prixliv,proprietaire,destinaire,
                                           depart,arrivee,**dateprestation**)
                         values(?,?,?,?,?,?,?,?,?,?,?)"
                      );

    $colis=array($code,$libelle,$typecolis,$poid,$prixliv,$proprietaire,
                              $destinaire,$depart,$arrivee,$dateprestation);

    if($pr->execute($colis)){
        echo"good";
    }else{
        echo"not good";
    }


}

0 Answers