title: #1264 Out of range value fix?
body: <p>When I try to insert the below into my MySQL</p>
  
  <pre><code>INSERT INTO `rooms` (`id`, `ip`) VALUES ('131213', '-259857341');
  </code></pre>
  
  <p>I fails with the follow error:</p>
  
  <pre><code>Warning: #1264 Out of range value for column 'ip' at row 1
  </code></pre>
  
  <p>I am looking around but haven't found how to fix or work it out...</p>
  
  <p><strong>My field is unsigned int</strong> which should work just fine for that entry.</p>
  
  <p><strong>What is the problem and how do I solve ?</strong></p>
  
  <p>I am using unsigned int because I wanted to store ips using inet_ntoa/aton.</p>
  
  <p>EDIT:</p>
  
  <p>I am using unsigned INT as recommend in MySQL website:</p>
  
  <blockquote>
    <p>To store values generated by
    INET_ATON(), use an INT UNSIGNED
    column rather than INT, which is
    signed. If you use a signed column,
    values corresponding to IP addresses
    for which the first octet is greater
    than 127 cannot be stored correctly.
    See Section 10.6, “Out-of-Range and
    Overflow Handling”.</p>
  </blockquote>
  
  <p><a href="http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html</a></p>