$database->setQuery("INSERT INTO `#__tablename` (`id`, `TicketId`,`Requested`)
values('', '".$database->getEscaped(trim($_REQUEST['tktnum']))."',
'".JFactory::getDate()->toFormat()."')");
$database->query();
if ($database->getErrorNum()) { echo "records inserting failed";}
else { echo "record inserting completed successfully"; }
here $database->getErrorNum() call is essential to determine
whether inserting was successful or a failure.
how to update data row in specific joomla table?
It's the same way as above but query will be update query like this one -
$database->setQuery("UPDATE `#__mysqltable` SET `Status`='1'
WHERE `TicketId`='1'");
how to delete data row in specific joomla table?
It's also the same way as i wrote above.An example of the query -
$database->setQuery("delete from `#__phptablename` where `id`='5'");
If you have questions about this post or any topics, post your questions in
discussions/forum in this website, you will get your answer