You are here: Re: getter/setter methods not working « PHP Programming Language « IT news, forums, messages
Re: getter/setter methods not working

Posted by Janwillem Borleffs on 10/09/21 11:38

Greg Scharlemann wrote:
> For some reason, I am having trouble retrieving the data that I store
> in the object that I have created from a database query. I created
> this class Lead (see below). In the php page, I create and array of
> Lead objects and later on down the page I iterate through the array of
> leads, retrieving each Lead and calling the get methods. However the
> get methods are not returning any values. I think I've copied the
> important parts of the code below, does anything standout around why
> my $lead->getFirstName() is returning ""? Thanks in advance.
>
> class Lead:
> -------------------------------------------------
> class Lead {
[...]
> function Leads($firstName, $lastName, $email, $phone, $leadID) {
> $this->firstName = $firstName;
> $this->lastName = $lastName;
> $this->email = $email;
> $this->phone = $phone;
> $this->leadID = $leadID;
> }
>

Incorrect constructor name; it should be Lead instead of Leads.


JW

 

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

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