title: How do I query a mysqli select with "one more row backwards"?
body: <p>Let's have a table called <code>weights</code>, in which I have my weight entries, like this:</p>
  
  <pre><code>id | time       | weight
  1  | 1328140800 | 140
  2  | 1328400000 | 142
  3  | 1328659200 | 141
  4  | 1329004800 | 144
  5  | 1329044800 | 148
  </code></pre>
  
  <p><code>time</code> is in unixtime and the entries are at <strong>random</strong> times. I can entry my weight every hour, or I can entry my weight every month.</p>
  
  <p>Now, I want to echo a graph of my weight during a certain time range, but for that, I also need <strong>one more weight before that time range.</strong></p>
  
  <p>Example:</p>
  
  <p>I'm requesting my weight WHERE:</p>
  
  <pre><code>`time` &gt;= 1328659200 AND `time` &lt;= 1329044800
  </code></pre>
  
  <p>This query will return these rows:</p>
  
  <pre><code>3  | 1328659200 | 141
  4  | 1329004800 | 144
  5  | 1329044800 | 148
  </code></pre>
  
  <p>And to these I need to add one more row before them. That would be this:</p>
  
  <pre><code>2  | 1328400000 | 142
  </code></pre>
  
  <p>How can I achieve this?</p>
  
  <p>Let's say the my query is:</p>
  
  <pre><code>SELECT *
  FROM `weights`
  WHERE `time` &gt;= 1328659200 AND `time` &lt;= 1329044800
  </code></pre>