5
Hi Trabis sorry to worry u again i tried the method u shown above to retrieve data from database but i am getting this error
atal error: Call to a member function getVars() on a non-object in C:\xampp\htdocs
here is my class
<?php
if (!defined("XOOPS_ROOT_PATH")) {
die("XOOPS root path not defined");
}
//create the xoopsobject for crud opeation
class AudioAudio extends XoopsObject
{
function AudioAudio()
{
$this->__construct();
}
function __construct()
{
$this->initVar("id", XOBJ_DTYPE_INT);
$this->initVar("source", XOBJ_DTYPE_TXTBOX);
$this->initVar("title", XOBJ_DTYPE_TXTBOX);
$this->initVar("download", XOBJ_DTYPE_TXTBOX);
$this->initVar("size", XOBJ_DTYPE_TXTBOX);
$this->initVar("type", XOBJ_DTYPE_TXTBOX);
$this->initVar("date", XOBJ_DTYPE_TXTBOX);
}
}
class AudioAudioHandler extends XoopsPersistableObjectHandler
{
function AudioAudioHandler(&$db)
{
$this->__construct($db);
}
function __construct(&$db)
{
parent::__construct($db, 'audios', 'AudioAudio', 'id');
}
}
?>
here i am trying to retireve
$obj_handler =& xoops_getModuleHandler('audio','audio');
$obj = $obj_handler->getAll($criteria = null, $fields = null, $asObject = true, $id_as_key = true);
echo "<tr class='odd'><td>".$obj->getVars("source")."</td>
<td>".$obj->getVars("title")."</td>
<td>".$obj->getVars("type")."</td>
<td>".$obj->getVars("date")."</td>";
in a debug it shows select * from audios but it i canot list the data due to the error above