php incrementing while loop
<pre><code>$blanknumber = $_POST["blankstartnumber"];

while ($blanknumber &lt;= ($_POST["blankendnumber"] ))
{    

echo "$blanknumber";
$blankid = $blanknumber;

$query = "INSERT INTO blank (Blank_ID) VALUES ('$blankid')";

mysql_query($query,$con);
$blanknumber++;

}
</code></pre>

<p>So the values are added into the database. Lets say if I have the starting number at 1 and ending at 5. It will all the those values, but it's still trying to add more into the database. I also tried adding an IF statement aswell. <code>if ($blanknumber != $_POST["blankendnumber"])</code></p>

<blockquote>
  <p>12345 Error: Duplicate entry '5' for
  key 'PRIMARY'</p>
</blockquote>
