From: "Mark" <[EMAIL PROTECTED]>
> --- Micah Montoy <[EMAIL PROTECTED]> wrote:
> > I am trying to specify a single php file to contain all the
> > variables and I
> > just call this file where necessary. What I am running into is
> > that I want
> > to do this for all the built in functions (i.e. mssql_query) as
> > well. I've
> > tried numerous attempts but can't get it to operate without wanting
> > to run
> > the functions or return an error. Something like this:
> >
> > $runQuery = @mssql_query;
> > $qryResults = @mssql_result;
> > $getRow = @mssql_fetch_row;
> > $getRowNums = @mssql_num_rows;
>
> Use a database abstraction class (ADODB, Pear, or something from
> phpclasses.org). You're trying to assign a variable to a function's
> actions, when you can only assign the variable to teh ooutput of the
> function.
A good suggestion, since this is what your creating, basically.
Anyhow, if you really want to do it your way, it'd be like this:
$runQuery = 'mssql_query';
$getRow = 'mssql_fetch_row';
Then you'd use them like this:
$result = $runQuery("select ... ");
while($row = $getRow($result))
{
...
}
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php