Re: A prob with a module maybe??
| From: | Alon Solell | Date: | Wed, 23 Apr 2003 18:42:11 +0000 |
| Subject: | Re: A prob with a module maybe?? | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19579@lists.php.net to get a copy of this message | ||
Hey Toby,
So far I decided to drop the ball on that code as something was really
weired in it. The part of the code
it is failing on, shouldn't even be executing as it is set to a 'mysql'
type.
I just decided to kick out the rest of the code which is suppose to be
working with the other databases
(it would have been nice to have,.but since I'm gonna be working with mysql
anyhow,.. there is no need
to stay and ponder on the "why it doesn't work" since it won't matter going
forwared).
Now for the reason of the double ext.
The php parser will provide an additional 'security' by parsing any file it
finds with a .php .
So,.. I do include statements of the files with the php and hide the config
files from outside users.
(they really don't need to know the database name, password etc).
Thanks for your help.
-Alon.
----- Original Message -----
From: "Toby z" <blue_myth_1@yahoo.com>
Newsgroups: php.windows
To: "Alon Solell" <js@wsco.com>; <php-windows@lists.php.net>
Sent: Tuesday, April 22, 2003 12:30 PM
Subject: Re: [PHP-WIN] A prob with a module maybe??
> hay alon
>
> a shot in the dark
>
> try to replace " by ' for ur variables
>
>
> mmmm a thing i cant get is
> >c:\localhost\treeview\Config\php-dbi.inc.php
>
> whatz with php-dbi.inc.php ?????
> how come the file has tow extensionz :S
> or am i too dammed ignorent at this ????? :S
>
>
> good luck
>
> toby
>
>
> --- Alon Solell <js@wsco.com> wrote: > I just finished install and
> run of PHP and Apache on WinXP.
> > I have a script that runs clean on a Linux already configured
> > system (my hosting provider) and I tried to ran the same
> > script on my local machine. I get errors, which I belive are
> > due to a missing module of some sort. I just don't know
> > which module.
> >
> > "Fatal error: Only variables can be passed by reference"
> >
> > or the full error:
> >
> > Fatal error: Only variables can be passed by reference in
> > c:\localhost\treeview\Config\php-dbi.inc.php on line 168
> >
> >
> > The function itself:
> >
> >
> > // Retrieve a single row from the database and return it
> > // as an array.
> > // Note: we don't use the more useful xxx_fetch_array because not
> > all
> > // databases support this function.
> > function dbi_fetch_row ( $res ) {
> > if ( strcmp ( $GLOBALS["db_type"], "mysql" ) == 0 ) {
> > return mysql_fetch_array ( $res );
> > } else if ( strcmp ( $GLOBALS["db_type"], "oracle" ) == 0 ) {
> > if ( OCIFetchInto ( $GLOBALS["oracle_statement"], &$row,
> > OCI_NUM + OCI_RETURN_NULLS ) )
> > return $row;
> > return 0;
> > } else if ( strcmp ( $GLOBALS["db_type"], "postgresql" ) == 0 ) {
> > if ( $GLOBALS["postgresql_numrows"] > $GLOBALS["postgresql_row"] )
> > {
> > $r = pg_fetch_array ( $res, $GLOBALS["postgresql_row"]++ );
> > if ( ! $r ) {
> > die("Unable to fetch row");
> > return '';
> > }
> > }
> > else {
> > $r = '';
> > }
> > return $r;
> > } else if ( strcmp ( $GLOBALS["db_type"], "odbc" ) == 0 ) {
> > $num_fields = odbc_num_fields ( $res );
> > if ( ! odbc_fetch_into ( $res, $GLOBALS["odbc_row"]++, &$ret ) ) //
> > THIS IS
> > LINE 168 WHERE ERROR IS
> > return false;
> > return $ret;
> > } else {
> > dbi_fatal_error ( "dbi_fetch_row(): db_type not defined." );
> > }
> > }
> >
> >
> > The script in question has been (and still is) running perfect on
> > Linux
> > system (two separate systems).
> > The install on WinXP is the one failing.
> > My take on this is that something is not enabled just right and
> > therefore it
> > is unable to process it
> > as it does on the Linux systems.
> > Any suggestions on what I need to enable? (i.e. any modules that
> > need to be
> > loaded up?).
> >
> > This is a call to a database (mySql).
> >
> > PHP Version 4.3.1
> > MySQL 3.23.49
> > Apache/1.3.27 (Win32)
> > WinXP Pro
> > P4 1.5Ghz
> > 256MB RAM
> >
> > -Alon.
> >
> > js@wsco.com
> >
> >
> >
> >
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> __________________________________________________
> Yahoo! Plus
> For a better Internet experience
> http://www.yahoo.co.uk/btoffer