Ik krijg de volgende foutmelding; "Fatal error: Call to a member function getEmail() on a non-object in"
Als ik deze met commentaar uitzet krijg ik dezelfde fout voor homepage, de eerste gaan dus wel goed...
Ik heb alles wel 100 keer nageken en voor email en homepage heb ik precies hetzelfde, kom er zelf dus niet meer uit :S hoop dat iemand me hier verder kan helpen..
onderstaand de oproepcode en classe
Ze worden aangeroepen in het volgende stukje code:
<?php
------------------------------------------------------------------------------
for ($i=0; $i<$aantalBerichten; $i++)
{
$bericht = $berichten[$i];
$id = $bericht->getId();
$naam = $bericht->getNaam();
$datum = $bericht->getDatum();
$tijd = $bericht->getTijd();
$bericht = $bericht->getBericht();
$email = $bericht->getEmail();
$homepage = $bericht->getHomepage();
rest....
-------------------------------------------------------------------------------
De classe die hierbij hoort is;
-----------------------------------------------------------------------
class Bericht extends basic
{
private $naam;
private $datum;
private $tijd;
private $bericht;
private $email;
private $homepage;
function getNaam()
{
return $this->naam;
}
function getDatum()
{
return $this->datum;
}
function getTijd()
{
return $this->tijd;
}
function getBericht()
{
return $this->bericht;
}
function getEmail()
{
return $this->email;
}
function getHomepage()
{
return $this->homepage;
}
function setNaam($naam)
{
$this->naam = $naam;
}
function setDatum($datum)
{
$this->datum = $datum;
}
function setTijd($tijd)
{
$this->tijd = $tijd;
}
function setBericht($bericht)
{
$this->bericht = $bericht;
}
function setEmail($email)
{
$this->email = $email;
}
function setHomepage($homepage)
{
$this->homepage = $homepage;
}
function select($id)
{
global $db;
$query = "SELECT * FROM ".TABLE_GASTENBOEK." WHERE id=".$id;
$result = $db->query($query);
if ($db->num_rows($result) == 1)
{
$row = $db->fetch_object($result);
$this->id = $row->id;
$this->naam = $row->naam;
$this->datum = $row->datum;
$this->tijd = $row->tijd;
$this->bericht = $row->bericht;
$this->email = $row->email;
$this->homepage = $row->homepage;
return true;
}else{
return false;
}
}
?>-----------------------------------------------------------------------------------
[modedit]Let even op je code tags[/code]