saving data in database
Posted: Thu Mar 13, 2008 12:26 pm
i am having problem while saving data into database from a form.
whenever i try to save the data it shows the following error
Fatal error: Call to a member function bind() on a non-object in d:\wamp\www\Joomla\administrator\components\com_hello\admin.hello.php on line 49
save function definition is as follows.
function saveHello(){
global $mainframe;
$row =& JTable::getInstance('hello', 'Table');
if(!$row->bind(JRequest::get('post')))
{
JError::raiseError(500, $row->getError() );
}
$row->message = JRequest::getVar( 'message', '','post', 'string', JREQUEST_ALLOWRAW );
if(!$row->store()){
JError::raiseError(500, $row->getError() );
}
$mainframe->redirect('index.php?option=com_hello', 'Message Saved');
}
14 views still no reply!!!!!!!!!!
nybody pls help!
this code is not the original one that i hav used. this one is from a tutorial about saving data into the database.
whenever i try to save the data it shows the following error
Fatal error: Call to a member function bind() on a non-object in d:\wamp\www\Joomla\administrator\components\com_hello\admin.hello.php on line 49
save function definition is as follows.
function saveHello(){
global $mainframe;
$row =& JTable::getInstance('hello', 'Table');
if(!$row->bind(JRequest::get('post')))
{
JError::raiseError(500, $row->getError() );
}
$row->message = JRequest::getVar( 'message', '','post', 'string', JREQUEST_ALLOWRAW );
if(!$row->store()){
JError::raiseError(500, $row->getError() );
}
$mainframe->redirect('index.php?option=com_hello', 'Message Saved');
}
14 views still no reply!!!!!!!!!!
nybody pls help!
this code is not the original one that i hav used. this one is from a tutorial about saving data into the database.