PHP problem while adding/editing on the same page
<p>Currently I am using same page while adding and editing records in my php/mysql driven website. Adding works fine, but while updating there is a problem for which i am seeking help.</p>

<p>There are 2 pages
managedata.php shows the record from the table and to edit the record there is a edit button from which i am sending 2 values update=1 and id=n (the id of the data which i will be editing) and it takes me the the adddata page like this</p>

<pre><code>adddata.php?update=1&amp;id=7
</code></pre>

<p>and in the adddata page if i edit the fields and click save in first shot it works perfectly
but if there are any errors and i show the errors then the url changes to </p>

<p>adddata.php 
so update mode will be false and it creates the new record</p>

<p>I am seeking help for this problem.
1) How can i set the value in querystring (how many time the page reloads) so updatemode will always be 1.</p>

<p>Thanks  </p>
