Re: require/include using a class ...
| From: | (Mark Walter) | Date: | Tue, 25 Jul 2000 17:10:26 +0000 |
| Subject: | Re: require/include using a class ... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-12304@lists.php.net to get a copy of this message | ||
Hallo Daniel,
> First of all, I stuck your code, verbatim, into a file and ran it. The
> following error came up:
Thanks a lot.
> Fatal error: mysql is already a function or class in
> g:\webroot/ideasphp/test.htm on line 5
> So, I renamed the name of the class from mysql to Oggle and got the following
> error:
This was really the problem. I also renamed that file and it worked. : )
> Needs to be modified, replacing the $ before mysql with ! and adding a parens
> at the end.
> if(!mysql_select_db($dbase,$conn))
This was my fault. You're absolutly right.
> I don't know why you're performing this step:
> $pass = $this->PASS;
> $dbase = $this->DBASE;
> Just use $this->SERVER; (etc) in your functions, like this:
> mysql_select_db($this->DBASE,$conn)
The code is based on a german book author and as I'am now able to see your
performance is quite easier to write. I think I will take on your style to
be included in my classes. :-) Possibly he thought his way would be more
convenient to come to know concerning creating objects. I solved the
problem and will post the next thread to the database list as the class
works now very well. Thank you.
Never mind !
cu
--
Mark-Walter@t-online.de