title: Error while storing phone numbers in mysql using php
body: <p>I have some phone numbers (validated such that all containing only integers, no <code>-</code> or <code>+</code> in them) as strings in a text file.</p>
  
  <p>I am doing a simple mysql update on a mysql table which has phone number column as int(12). Note that I convert each phone number extracted from the text file to integer using intval().</p>
  
  <p>The problem that I am facing is that instead of the numbers being inserted I just get <strong>2147483647</strong> to be inserted in each column. I guess I am making a small silly mistake somewhere, but still I can't figure it out. Can anyone explain what mistake am I making?</p>
  
  <p><strong>EDIT:</strong> Here is my the piece of code I am using (It does not give any sql error):</p>
  
  <pre><code>$sql="UPDATE ".$table." SET mobile = ".intval($smob).", phone = ".intval($sphone)." WHERE roll='".$sroll."'";
  mysql_query($sql, $con) or die(mysql_error());
  </code></pre>