title: Datediff issue - PHP,Mysql
body: <p>So in my database i've got <strong>regdate</strong> (date type), but no matter what date it is, the code keeps returning 1. </p>
  
  <pre><code>&lt;?php
  $con = mysqli_connect("localhost","root","","login");
  
  if (mysqli_connect_error()) {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  
  $result = mysqli_query($con,"SELECT * FROM users");
  $row = $result-&gt;fetch_array();
  
  $date1 = new DateTime($row['regdate']);
  $date2 = new DateTime("now");
  $interval = $date1-&gt;diff($date2);
  echo "It has been " .$interval-&gt;d." days ";
  //$interval is supposed to be difference between regdate and todays date
  </code></pre>
  
  <p>I hope I'm not missing something stupid. Thank you for your anwers.</p>
  
  <p><strong>SOLVED</strong></p>