Hi
I would like to get the id of a new row throught form process, and save it in a new table's element with a random name containing the id record.
I explain : this php code takes the id number (id=1), rename it in "AAAA-1", and save it in reference_articles table :
But i would like to have a random rename like BTFR-1 or ZGVX-1 instead alway AAAA..
any ideas?
I would like to get the id of a new row throught form process, and save it in a new table's element with a random name containing the id record.
I explain : this php code takes the id number (id=1), rename it in "AAAA-1", and save it in reference_articles table :
PHP:
$rowid = $formModel->getRowId();
if (!empty($rowid)) {
$db = JFactory::getDBO();
$newNumber = "AAAA-" . $rowid;
$query = $db->getQuery(true);
$query->update('core_articles')->set("reference_articles = '$newNumber'")->where("id = $rowid");
$db->setQuery($query);
$db->query();
}
But i would like to have a random rename like BTFR-1 or ZGVX-1 instead alway AAAA..
any ideas?