Tried this and it returns errors of type: Warning: Wrong parameter count for mssql_result() in c:\inetpub\wwwroot\webpage10\example\utilities\dsp_del_images.php on line 78
Warning: mssql_result(): supplied argument is not a valid MS SQL-result resource in c:\inetpub\wwwroot\webpage10\example\utilities\dsp_del_images.php on line 79 Warning: Wrong parameter count for mssql_result() in c:\inetpub\wwwroot\webpage10\example\utilities\dsp_del_images.php on line 78 Warning: mssql_result(): supplied argument is not a valid MS SQL-result resource in c:\inetpub\wwwroot\webpage10\example\utilities\dsp_del_images.php on line 79 Lines 78 and 79 read like this: $img_numbers = $qryResults("SELECT COUNT(img_id) AS TotalImages FROM images WHERE category_id = '$row[0]'"); $img_count = $qryResults($img_numbers,0,"TotalImages") The variables are specified as $runQuery = 'mssql_query'; $qryResults = 'mssql_result'; Any ideas of why it would be doing this? Everything works fine when I don't try to use the variables. thanks "Cpt John W. Holmes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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