|
Posted by Janwillem Borleffs on 10/18/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
[Back to original message]
|