Re: while inside a function
| From: | Raditha Dissanayake | Date: | Mon, 06 Dec 2004 05:13:40 +0000 |
| Subject: | Re: while inside a function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203555@lists.php.net to get a copy of this message | ||
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