I am using following code to keep user on the same form

<form name="form1" method="post" action="<? $PHP_SELF ?>" >

I am using
if (isset($Submit))
condition (i.e. click on submit button) to store a SQL query submitted.

However each time the array defined is inititalized ...

How can I avoid this ?
(in current scenario the query is being stored in variable however is initialised after next submit and I dont want to loos any information stored...)

Please help

My function to store query is also given below

function storequery()
echo "function store query<br>";
global $queryinsert; // this is used in $isset and used here ..

global $arnm; // array in which I want to store the query

$kount =count($arnm[$kount])+1;

echo "<br>after assigning query in kount =".$kount;

echo "<br>No of elements stored in an array =".count($arnm)."<br>" ;

echo "<br>Last details in array =".$arnm[$kount]."<br>";

echo "<br>after assigning count of array ...count kar =".$kar[$kount]."<br>";


In short

After storing 1st query the array $arnm will be storeing 1 element and hence the count function will return 1 (which is happening)

After next submit the function count($arnm) should return 1 and the next query statement will be stored as 2nd element

This is not happening..
I am always getting number of elements in array = 0
after storing the query it is always the first element

thus count($arnm) returns always = 1

Please help