RE: [PHP-WIN] Simple function question

2002-05-09 Thread Scott Hurring
> Sent: Thursday, May 09, 2002 3:02 PM > To: 'Php-Win (E-mail)' > Subject: [PHP-WIN] Simple function question > > > Ok, I just read a section in a book about functions. In my cost I have > some variables set: > > $var1 = "1"; > > And I

Re: [PHP-WIN] Simple function question

2002-05-09 Thread Bradley Miller
At 03:02 PM 5/9/02 -0400, Matt Babineau wrote: >Ok, I just read a section in a book about functions. In my cost I have >some variables set: > >$var1 = "1"; > >And I have a function I wrote that needs to utilize that variable. > >function runvar(){ >query database looking for $var1; >

Re: [PHP-WIN] Simple function question

2002-05-09 Thread Scott Carr
Use $GLOBALS['var1'] That will get the variable from the correct scope. -- Scott Carr OpenOffice.org Whiteboard-Doc Maintainer http://whiteboard.openoffice.org/doc/ Quoting Matt Babineau <[EMAIL PROTECTED]>: > Ok, I just read a section in a book about functions. In my cost I have > some varia

[PHP-WIN] Simple function question

2002-05-09 Thread Matt Babineau
Ok, I just read a section in a book about functions. In my cost I have some variables set: $var1 = "1"; And I have a function I wrote that needs to utilize that variable. function runvar(){ query database looking for $var1; } I get horrible errors though. In the book it talked