Include / Require

From: Date: Thu, 05 Apr 2001 17:56:45 +0000
Subject: Include / Require
Groups: php.general 
Request: Send a blank email to php-general+get-47299@lists.php.net to get a copy of this message
I have a DB project going and every time I query the DB for data from a particular table, I want to include a set of variables (that get set based on the query result). I was thinking of doing something like this: $sql = "..." $result = ....; include 'variables.php?table=$table'; However, every time I try that, it tells me it can't find 'variables.php'. However, if I rename the file to 'variables.inc', it does find it (though it doesn't pass any arguments to it then). The first method tells me it's not in the include path. Okay, easily fixable in php.ini, however, I don't want this extra path info to apply to the whole server (which is running several vhosts). How can I adjust the include path just for this particular vhost? Or, is there a better way to do what I'm trying to accomplish? Make it a function perhaps? A call that would look kinda like this perhaps: variables($table) ? But then, how do I get to the actual variables? AMK4 -- W | | I haven't lost my mind; it's backed up on tape somewhere. |____________________________________________________________________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ashley M. Kirchner <mailto:ashley@pcraft.com> . 303.442.6410 x130 SysAdmin / Websmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . eFax 248.671.0909 http://www.pcraft.com . 3550 Arapahoe Ave #6 .................. . . . . Boulder, CO 80303, USA

« previous php.general (#47299) next »