מה אני עושה לא נכון?
לפי הזכרון שלי לא צריכה להיות בעיה עם פונקציות בתוך פונקציה.
אולי הדרך שבה אני עושה "call" היא לא נכונה?
$files->cat->create('cat1', 'cat1.gif') or die('Could not create category: ' . mysql_error());
|
הקוד שעומד מאחורה הוא:
class fileManager extends dbConn { var $catId, $catImg, $catName; var $fileId, $fileCid, $fileAid, $filePost; var $fileName, $fileDescr, $fileImg, $fileURL, $filePw; var $clicks, $hits, $info; function cat ( ) { function create ( $catName, $catImg ) { $this->catName = $catName; $this->catImg = $catImg; parent::qry( "INSERT INTO `table` ( `name`, `img` ) VALUES ( '$this->catName', '$this->catImg' )" ); } ... ...
|
והשגיאה המתקבלת:
Fatal error: Call to a member function create() on a non-object in D:\Program Files\xampp\htdocs\prj\index.php on line 13
|
:<, ?, !!!
THX TO THE OZRIM
