Mam taki kawałek kodu:
plik 1
<?php include "adodb/adodb.inc.php"; $db = NewADOConnection('mysql'); $db->Connect("", "", "", "xxx"); $_SESSION['db'] = $db; } ?>
plik2
<?php include "image.class.php" ; $db = $_SESSION['db']; $image = new Image($db); $image->del_foto($_SESSION['uid']); ?>
kawalek klasy Image
<?php var $poz; var $name; function __construct($db){ $this->db = $db; } function del_foto($user_id){ $query = "SELECT pozycja,image FROM aaa WHERE user_id = $user_id"; $result =$this->db->Execute($query); //dalsza czesc chyba nieistotna ?>
W plik 1 z poziomu ajaxa chce wywolac metode del_foto, niestety wywala mi blad
Cytat
Fatal error: Image::del_foto() [<a href='function.Image-del-foto'>function.Image-del-foto</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "ADODB_mysql" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in D:\Apache2.2\htdocs\newsy\includes\user\image.class.php on line 15
linijka 15 to
Cytat
$result =$this->db->Execute($query);