I can't figure this out. I have a line where I include a file

include "/Library/WebServer/includes/database_connection.inc";

I want to have this declared in one location, so that I don't have to change multiple lines if I ever move the application, everything works fine except inside functions. So if I have the following:

include "/Library/WebServer/includes/database_connection.inc";

function list_search_results()
{
        // my code that lists search results
}

The functions returns an error, but if I do this:


function list_search_results() { include "/Library/WebServer/includes/database_connection.inc"; // my code that lists search results }

Everything works fine. Shouldn't the function be able to use the include file when it is declared outside the function?

Mike


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



Reply via email to