static variable declaration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello everybody,

                 I am having one doubt in static
variable declaration,whether static variable works
only with in the function if that function is  called
more than one times.this is my code facind problem.

 STATIC $m=0;
 if($m==0):
             
             $m=$m+1;
    print "<a
href=\"tradesummary_pg2.php?m=$m\">next</a>";         
  

 elseif($m<($k-1)):
                   
             print "<a
href=\"tradesummary_pg2.php?m=$m-1\">previous</a><a
href=\"tradesummary_pg2.php?m=$m+1\">next</a>";

else:
             print "<a
href=\"tradesummary_pg2.php?ID=$ID&m=$m-1\">previous</span></td><td></td></tr>";

endif;


  u have seen yahoo mail inbox with Next ,previous
links in bottom. i want to implement same
functionality locally.i did my coding and i am facing
a problem, that  when i click the next link $m value
incremented to 1 for first time and when i click next
for second time ,$m value is not incrementing,i
declared $m as STATIC .i am looking forward
suggestions from ur any one.



                         A.suresh

                            


		
__________________________________________________________ 
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux