how to use multiple $_name using extends Zend_Db_Table_Abstract in zend frame work.
- by karthik
we tried to give our tables(users,messages) like this in two different abstract classes but it is not working.
This is included in a file childconnect1.php ,is there any relation between the file name(childconnect1.php) and the class(Application_Model_childconnect1).
class Application_Model_childconnect1 extends Zend_Db_Table_Abstract
{
protected $_name = 'users';
public function loginvalidation($username,$pwd)
{
$row = $this->fetchRow('UserName = \'' . $username . '\'and UserPW = \''. $pwd . '\'');
if (!$row)
{
$msg="invalid";
return $msg;
}
else
{
return $row->toArray();
}
}
}
class Application_Model_childconnect2 extends Zend_Db_Table_Abstract
{
protected $_name = 'messages';
public function replymessage($message)
{
$data=array(
'MessageText'=>$message
);
$this->insert($data);
}
}