// Setup the function like this
function runvar ($var1) {
...
}

// Call it like this
runvar($var1);

---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515

> -----Original Message-----
> From: Matt Babineau [mailto:[EMAIL PROTECTED]]
> 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 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 about the local
> fuciton scope not being able to communicate with the global scope. How
> can I pass $var1 into the function so it can be used?
 

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

Reply via email to