title: Inserting datetime values in mysql database through mysqli in php
body: <p>SO I inputted values through a datetime jquery plugin and now i am inserting the values in my database through mysqli php extension .
  But the problem is it is not inserting.It always goes into the else condition. I have my form in scheduler.php page from there i am sending values to allforms.php from there i am calling add method of class Scheduler which resides in user.php page</p>
  
  <p>allforms.php page</p>
  
  <pre><code>    $operation = $_POST['operation'];
          if($operation == 'add'){
                  $request = getSchedule();
                  $scheduler = new Scheduler($request['title'],$request['urgency'],$request['meeting'],$request['minfo'],$request['snooze'],$request['textbox'],$request['datetime']);
                  $result = $scheduler-&gt;add();
                  echo $result;
          }   
          function getSchedule(){
              $request = [];
              $request['title'] = isset($_POST['title']);
              $request['urgency'] = isset($_POST['urgency'])?$_POST['urgency']:'';
              $request['meeting'] = isset($_POST['meeting'])?$_POST['meeting']:'';
              $request['minfo'] = isset($_POST['minfo'])?$_POST['minfo']:'';
              $request['snooze'] = isset($_POST['snooze'])?$_POST['snooze']:'';
              $request['textbox'] = isset($_POST['textbox'])?$_POST['textbox']:'';
  
              $request['datetime'] = isset($_POST['datetime'])?strtotime($_POST['datetime']):'';
              $request['datetime'] = date("Y-m-d",$request['datetime']);
              return $request;
          }
  </code></pre>
  
  <p>scheduler.php Page</p>
  
  <pre><code>class Scheduler {
      public $title;
      public $urgency;
      public $meeting;
      public $minfo;
      public $snooze;
      public $textbox;
      public $datetime;
      public function __construct($title,$urgency,$meeting,$minfo,$snooze,$textbox,$datetime){
              $this-&gt;title =$title;
              $this-&gt;urgency = $urgency;
              $this-&gt;meeting = $meeting;
              $this-&gt;minfo =$minfo;
              $this-&gt;snooze = $snooze;
              $this-&gt;textbox = $textbox;
              $this-&gt;datetime = $datetime;
              $connection = new Connection();
              $this-&gt;connect = $connection-&gt;connect();
      }
      public function add(){
          $sql = "INSERT INTO 
                      Meeting (title, urgency, meeting, minfo, snooze, textbox, datetime) 
                      VALUES ('{$this-&gt;title}', '{$this-&gt;urgency}', '{$this-&gt;meeting}', '{$this-&gt;minfo}','{$this-&gt;snooze}','{$this-&gt;textbox}','{$this-&gt;datetime}')";
          $result = $this-&gt;connect-&gt;query($sql);
          if($result)
              {
                  return  $this-&gt;title ." has been registered ";
              }else {
                  return  "Some error occured and we couldn't add the event";
              }
          }
  
      }
  </code></pre>
  
  <p>scheduler.php Page</p>
  
  <pre><code> &lt;form class="form-group" method="POST" action="allforms.php" &gt;
              &lt;div&gt;
                  &lt;label&gt;&lt;b&gt;Title&lt;/b&gt;&lt;/label&gt;
                  &lt;input type="text" placeholder="Enter your title here" name="title" &gt;
              &lt;/div&gt;
                &lt;div&gt;
                  &lt;label&gt;&lt;b&gt;Urgency Level&lt;/b&gt;&lt;/label&gt;
                  &lt;select name="urgency" class="textbox" &gt;
                    &lt;option value="Low"&gt;Low&lt;/option&gt;
                    &lt;option value="Normal"&gt;Normal&lt;/option&gt;
                    &lt;option value="Critical"&gt;Critical&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;label&gt;&lt;b&gt;Meeting Type&lt;/b&gt;&lt;/label&gt;
                  &lt;select name="meeting" class="textbox"&gt;
                    &lt;option value="Telephonic"&gt;Telephonic&lt;/option&gt;
                    &lt;option value="Offline"&gt;Offline&lt;/option&gt;
                    &lt;option value="Online"&gt;Online&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;label&gt;&lt;b&gt;Meeting Info&lt;/b&gt;&lt;/label&gt;
                  &lt;input type="text" name="minfo" placeholder="Enter location name , number or skype id ,etc."&gt;
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;label&gt;&lt;b&gt;Snooze&lt;/b&gt;&lt;/label&gt;
                  &lt;input type="number" placeholder="Enter Snooze time in minutes" name="snooze" class="textbox"&gt;
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;label&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/label&gt;
                  &lt;textarea name="textbox" class="textbox"&gt;&lt;/textarea&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                      &lt;label&gt;&lt;b&gt;Date/Time of the meeting&lt;/b&gt;&lt;/label&gt;
                      &lt;input type='text' id="datetimepickr" class="form-control" name="datetime"&gt;
              &lt;/div&gt;
              &lt;input type="hidden" name="operation" value="add"&gt;
              &lt;button type="submit" name="add"&gt;Submit&lt;/button&gt;
              &lt;/form&gt;
  </code></pre>