ok, since no one has replied, i try to ellaborate.
this problem is happening on two servers - my one machine (localhost based on windows) and a large webserver (based on linux). the php and mysql versions on these two servers are different - so no version specific problem.
it seems that a) the page with the form is taken from browser cache, b) the array that i use to build the form is kept in memory, or c) mysql or php somehow uses the previous query to create the from.
a) i am using all the nessecary http headers to prevent caching (pragma, cache-control and expiring date set to 1980). i have also turned off every cache option in the browser. however, when i use mozilla to view the page info, it says that source of the page is memory cache.
b) at the end of the function that builds the form from the arrays i unset all the array variables. if i try to access them with php after the function has ended, they don't display.
c) when i check the id that is used for the mysql query and that it obtains from get variables ($HTTP_GET_VARS['id']) before the mysql query it shows the new id. but when i check the id that was obtained from the query, the id is the old one. so it is quite possible that somehow the old query (or the result of it is used). this happens even if i unset the $sql variable that i use to do mysql_query or give it a value of = "";
to me it seems that c) is the culprit. but i have never encountered a similiar error so i don't know how to solve it. if anybody does, please reply.