View unanswered posts | View active topics It is currently Sat Aug 13, 2022 8:53 pm



Reply to topic  [ 1 post ] 
 Store data in array problem fails after submbit 
Author Message
Junior Member

Joined: Sat Mar 27, 2004 9:17 am
Posts: 4
Post 
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
";
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 "
after assigning query in kount =".$kount;
$arnm[$kount]=$queryinsert;

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

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

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

}

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

But
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


Sat Mar 27, 2004 9:22 am
Report this post
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.