title: Assinging a variable for date
body: <p>I need to assign a specific number like 1559 to today's date and calculate the previous and next days according to this.  For example 2 days ago is 1557, yesterday is 1558, today is 1559 tomorrow is 1560, etc.  With that, i will create a pagination for the days with post method.  My date is in YYYY-MM-DD format and stored in a date variable in mySQL. What should I do to assing numbers to dates and calculate the dates accordingly?</p>
  
  <p>my code looks like this btw:</p>
  
  <p>include ('connect.php');</p>
  
  <pre><code>    date_default_timezone_set("Etc/GMT+7");
      $timestamp= date("Y-m-d");
      $day1=1357;
  
      echo ('&lt;form action="total_inf.php" method="post" name="inf_day"&gt;');
      for($i=0;$i&lt;10;$i++)
  
      {
      $newdate=strtotime('-$i days',strtotime($timestamp));
      $newdate = date ( 'Y-m-d' , $newdate );
  
      $prevdays=$day1-$i;
  
      print ('&lt;input type="submit" name="bugun" value="'.$prevdays.'"&gt;&amp;nbsp;');
  
      }
      echo ('&lt;/form&gt;');       
  
      $day_selected=$_POST[bugun];
  
      $sql1="SELECT * FROM userdata WHERE zaman='$timestamp'";
      $result1=mysql_query($sql1,$conn);
  </code></pre>