neutrall Level: Scholar

 Registered: 28-03-2004 Posts: 43
|
Problem with a class.. again!!
Hi, workig out some bugs out of my admisnistration menu. This time, it's giving me problem with a method from the MySQL class (Uploaded in the download section).
This is the function calling to the class :
<?php function New_Forest_Creature($name, $strenght, $defence, $goldfound=0, $weaponfound=0, $defencefound=0, $weaponid=0, $defenceid=0, $questid=0, $level=0) {
$sql = "INSERT INTO Forest_Creature SET
/* ADD NEW RECORD HERE */
Level=$level";
$this->db->query($sql);
if ($this->db->isError()) {
return FALSE;
} else {
$this->Id = $this->db->insertID();
return TRUE;
}
} ?>
|
now my problem if the following line :
<?php
$this->Id = $this->db->insertID();
?>
|
I kept getting the error :
Fatal error: Call to undefined method MySQL::insertID() in J:\WEBSITE\WWW\class\forest_creature.php on line 242
Now I've triple check the MySQL class, and insertID is defined.... Any idea?
[Edited by neutrall on 12-05-2005 at 10:36 AM GMT]
[Edited by neutrall on 12-05-2005 at 10:37 AM GMT]
____________________________
A Stick give a wise man something to think about... and a fool, something to put in is mouth.
|