Page 1 of 1

saving data in database

Posted: Thu Mar 13, 2008 12:26 pm
by 7620
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.

Re: saving data in database

Posted: Sat Mar 15, 2008 3:24 pm
by radiant_tech
The error would indicate that it expects $row to be an object, but it is not.
Have you included the tables subdirectory and related table file in your component?