title: Converting html date and time to my database datetime column
body: <p>These are my html inputs</p>
  
  <pre><code>&lt;input id="6" type="date" name="start_date"&gt;
  &lt;input id="7" type="time" name="start_time"&gt;&lt;br&gt;
  &lt;input id="8" type="date" name="end_date"&gt;
  &lt;input id="9" type="time" name="end_time"&gt;&lt;br&gt; 
  </code></pre>
  
  <p>Then I use the post method to claim them like this</p>
  
  <pre><code>$start_date = (string) $_POST['start_date'];
  $start_time = (string) $_POST['start_time'];
  $end_date = (string) $_POST['end_date'];
  $end_time = (string) $_POST['end_time'];
  </code></pre>
  
  <p>and finally execute the query like this</p>
  
  <pre><code>$dateTimeStart="$start_date.' '.$start_time";
  $dateTimeEnd="$end_date.' '.$end_time";
  $dateTimeStart = date("Y-m-d H:i:s",strtotime($dateTimeStart));
  $dateTimeEnd = date("Y-m-d H:i:s",strtotime($dateTimeEndime));
  $sql="INSERT INTO appointment (prof_id, student_id, app_start, app_end) VALUES ('$prof_id', '(SELECT user_id FROM user WHERE firstname='$stud_first' AND lastname='$stud_last')', '$dateTimeStart', '$dateTimeEnd');";
  mysqli_query($conn, $sql);
  </code></pre>
  
  <p>But there seems to be something wrong.. can u help me?</p>