You know...maybe I should mention where this code is...

I have my main file which loads using 'require.once' a second file called
'everything.php'.

Inside everything.php is a class called 'mainclass' which is called by the
mail file.

This class ('mainclass') loads the MySQL class from the previous post which
is stored in yet another file, using require.once.

MainClass then calls the MySQL->CONNECT and MySQL->CHOOSEDB functions.

I know this sounds a bit over the top, but it works...at least it
did...until now. I thought I'd mention the circumstances in case that makes
a difference, which I suspect it will.

Thanks again!

Lewis

"Orangehairedboy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi everyone! I can't figure out why this doesn't work. The call to the
> CONNECT function works and it connects with no problem, and it does save
the
> Resource ID in $this->DBLink[]...however, when CHOOSEDB is called, the
> Resource ID just saved is gone. $this->DBLink is just empty, and I can't
> figure out why...
>
> Can anyone offer insight on this one?
>
> class MySQL
>  {
>  var $DBLink = array();
>  function CONNECT ( $MyVars , $MyContents )
>   {
>   $host = ( $MyVars[PORT] ) ? $MyVars[HOST] . ":" . $MyVars[PORT] :
> $MyVars[HOST];
>   $this->DBLink[$MyVars[NAME]] = mysql_connect( $MyVars[HOST] ,
> $MyVars[USERNAME] , $MyVars[PASSWORD] );
>   }
>  function CHOOSEDB ( $MyVars , $MyContents )
>   {
>   mysql_select_db( $MyVars[DATABASE] , $this->DBLink[$MyVars[LINK]] );
>   }
>  }
>
>
> Thanks!
>
>
> Lewis
>
>



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

Reply via email to