You are here: Re: PHP4 and this function « PHP Programming Language « IT news, forums, messages
Re: PHP4 and this function

Posted by NC on 01/24/06 00:42

Jon wrote:
> "Tony Marston" <tony@NOSPAM.demon.co.uk> said:
>
> > Ths function can only be used in an object as $this->connection refers
> > to a property called $connection within the current object. Have you
> > checked to see if $this->connection actually refers to a valid
> > resource? Where did the previous call to mysql_connect() store its
> > result?
>
> function constructor($host, $user, $pass, $database)
> {
>
> $this->connection = mysql_connect($host, $user, $pass) or die2
>
> This was modified from a more PHP5 compatible __constructor, and
> function cnstructor allowed it to "work" apparently, but not as well as
> I need it to.

In PHP 4, the consturctor has the same name as the class. So your
constructor() function is probably never executed.

Cheers,
NC

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация