title: Convert string to mysql date format before insert
body: <p><br>
  I have a form which is used to upload a .csv file to insert data in mysql table. The file has a date column in a format "dd/mm/yyy". However I want to insert this date string in mysql date format "yyyy-mm-dd". I have the following code so far.<br></p>
  
  <pre><code>//parse data from csv file line by line
          while(($line = fgetcsv($csvFile)) !== FALSE){
           //insert member data into database
           $db-&gt;query("INSERT INTO txns (txn_date, description, amount, status) VALUES ('".$line[0]."','".$line[1]."','".$line[2]."','".$line[3]."','".$line[3]."')");
              }
          }
  
          //close opened csv file
          fclose($csvFile);
  </code></pre>
  
  <p>Please help to convert the date string to mysql date (yyyy-mm-dd) format.</p>