title: how to get nearest value from database in mysql
body: <p>I am using <code>mySQL</code> and <code>CodeIgniter</code>. I have some floating point numbers in my database such as</p>
  
  <ul>
  <li>8.3456</li>
  <li>8.5555</li>
  <li>4.5556</li>
  </ul>
  
  <p>I want to...</p>
  
  <pre><code>SELECT * FROM table WHERE value = $myvalue
  </code></pre>
  
  <p>but I can't use <code>value = $myvalue</code> in my SELECT query because <code>$myvalue</code> is not exactly equal to database values. I need to get the nearest value to <code>$myvalue</code> from database. </p>
  
  <p>If <code>$myvalue</code> is 5 I want to select the value <code>4.5556</code>.</p>
  
  <p>How can I do this in mySQL?</p>