i am new to joomla.i design a form component for understand mvc pattern like contact form.i form show easily and it is viewable in front end now i want to understand how database is used in joomla.how i send form values to database which files we have to use model view controller.
// no direct access
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
//Load admin language file
$lang = JFactory::getLanguage();
$lang->load('com_new', JPATH_ADMINISTRATOR);
$document = &JFactory::getDocument();
$document->addStyleSheet(JURI::base() . 'C:\wamp\www\j25\components\com_new\assets\demo.css');
?>
<div class="item_fields">
<?php #if( $this->item ) : ?>
<form id="form-feild" action="#" method="post" class="form-validate" enctype="multipart/form-data">
<table class="body">
<tr><td><?php echo $this->form->getLabel('firstname'); ?></td><td></td><td><?php echo $this->form->getInput('firstname'); ?></td></tr>
<tr><td><?php echo $this->form->getLabel('middlename'); ?></td><td></td><td><?php echo $this->form->getInput('middlename'); ?></td></tr>
<tr><td><?php echo $this->form->getLabel('lastname'); ?></td><td></td><td><?php echo $this->form->getInput('lastname'); ?></td></tr>
<tr><td><?php echo $this->form->getLabel('gender'); ?></td><td></td><td><?php echo $this->form->getInput('gender'); ?></td></tr>
<tr><td><?php echo $this->form->getLabel('dateofbirth'); ?></td><td></td><td><?php echo $this->form->getInput('dateofbirth'); ?></td></tr>
<tr><td><?php echo $this->form->getLabel('address'); ?></td><td></td><td><?php echo $this->form->getInput('address'); ?></td></tr>
<tr><td><?php echo $this->form->getLabel('state'); ?></td><td></td><td><?php echo $this->form->getInput('state'); ?></td></tr>
<tr><td><?php echo $this->form->getLabel('postcode'); ?></td><td></td><td><?php echo $this->form->getInput('postcode'); ?></td></tr>
<tr><td><?php #echo 'index.php?option=com_details&task=feild.save'; ?></td></tr>
<table>
<div>
<button type="submit" class="validate"><span><?php echo JText::_('JSUBMIT'); ?></span></button>
<?php echo JText::_('or'); ?>
<a href="<?php echo JRoute::_('index.php?option=com_new&task=new.cancel'); ?>" title="<?php echo JText::_('JCANCEL'); ?>"><?php echo JText::_('JCANCEL'); ?></a>
<input type="hidden" name="option" value="com_new" />
<input type="hidden" name="task" value="new.save" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
note:->how action work on joomla.In few files i find like JRoute::_('index.php?option=com_new&task=new.save')
help me thank in advance