Re: while inside a function

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

 



Louie Miranda wrote:

i have a while statement inside a function, but it seems like it dont
work. is this possible?


Add the following lines:
global $apo;
global $row;

This will make it work for you but it's not the best solution. It's better to pass in parameters to the function rather than to rely on globals.


function hello() {

while ($apo->fetchInto($row)) {
print "hello 2";
}
}; /eof







--
Raditha Dissanayake.
------------------------------------------------------------------
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/ | Drag and Drop Upload


--
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