How about doing everything on page1.php. Use an if statement and a hidden variable, lets call it sent. When the page first comes up, $sent is not set. Then use something like:
if($sent) {
add the form info to your database
}
<form action="page1.php" method=post>
...
<input type=hidden name=sent value=1>
<input type=submit>
</form>
So when the form is first loaded, sql statement is ignored because $sent has not been set yet. When you submit the form, the sql statement is used because $sent now has a value, and the page is then reloaded.
Should work.
Jim