Call to undefined method
Jeg får denne fejl her og jeg kan ikke lige se hvad der skulle være galt.Fejl:
Fatal error: Call to undefined method Kategori::connect() in C:\wamp\www\test\test2.php on line 11
test.php :
include_once 'connect.php';
class Kategori {
public $navn;
public $id;
function UdskrivKategori() {
echo "<p>".$this->navn."...".$this->navn."</p>";
}
}
test2.php :
require_once('connect.php');
require_once('test.php');
$test_2 = new Kategori();
$test_2->connect();
$test_2->q("SELECT * FROM navn");
while($array = $test_2->a()){
$test_2->id = '<a href="index.php?page=test&id='. $array["id"] .'">'. $array["fornavn"] .'</a>';
$test_2->navn = $array["fornavn"];
}
$test_2->UdskrivKategori();
$test_2->close();
