title: count days from date from mysql table to today
body: <p>I need to calculate days number from subscribing date that i have in Mysql table to today, i need the number of days.</p>
  
  <pre><code>table name : mytable
  date field name : subdate
  </code></pre>
  
  <p>I tried this but it doesn't work:</p>
  
  <pre><code>$today = CURDATE();
  $subdate= ('subdate');
  $days = (strtotime($today) - strtotime($subdate)) / (60 * 60 * 24);
  </code></pre>
  
  <p>solved thanks :
  my final query :</p>
  
  <pre><code>$result = mysql_query("SELECT * FROM mytable WHERE country LIKE '$country' and city LIKE '$city and (datediff(CURDATE(), age))&gt;30");
  </code></pre>