O'Reilly logo

Learning Joomla! 1.5 Extension Development by Joseph L. LeBlanc

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Processing the data

Once the data in the form has been filled out and the admin clicks the Save button, we need to save the information into the database. To start, create a new function of saveSingle() in restaurants.php:

function saveSingle() { JRequest::checkToken() or jexit( 'Invalid Token' ); global $mainframe, $option; $row =& JTable::getInstance('review', 'Table'); if (!$row->bind(JRequest::get('post'))) { JError::raiseError(500, $row->getError() ); } $row->quicktake = JRequest::getVar( 'quicktake', '', 'post', 'string', JREQUEST_ALLOWRAW ); $row->review = JRequest::getVar( 'review', '', 'post', 'string', JREQUEST_ALLOWRAW ); if(!$row->review_date) { $row->review_date = date( 'Y-m-d H:i:s' ); } if (!$row->store()) { JError::raiseError(500, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required