Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create and populate an object.
- $value = new stdClass();
- $value->userid = (int)$userid;
- $value->type = $data['type'];
- // Insert the object into the user profile table.
- $handle = JFactory::getDbo()->insertObject('#__bestia_handles', $value);
- $db = JFactory::getDbo();
- $db->insertObject(...)
- $db->insertid();
- MyComponentTableMyTable extends JTable
- {
- public function save($src, $orderingFilter= '', $ignore= '')
- {
- /*call parent save function and return either insertid or null depending on whether or not parent save function returns true or false */
- return ( parent::save ( $src, $orderingFilter, $ignore ) ? $_db->insertid () : NULL ) ;
- }
- }
Add Comment
Please, Sign In to add comment