/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//Create row object $db = JFactory::getDBO(); $row = new JObject(); $row->created_by = (int)$user->id; $row->title = 'My Favorites'; $row->alias = JFilterOutput::stringUrlSafe($row->title); //format in slashed alias format $row->default = 1; //third parameter is key field $ret = $db->insertObject('#__jxgallery_lightboxes', $row, 'lightbox_id'); if (!$ret) { $this->setError($db->getErrorMsg()); return false; } //Get the new record id $lightbox = (int)$db->insertid();
Comments
