Controller file

Post.php

```
<?php

namespace QaisarSatti\HelloWorld\Controller\Index;

class Post extends \Magento\Framework\App\Action\Action

{

    protected $_objectManager;
    protected $hello;

    public function __construct(\Magento\Framework\App\Action\Context $context,
                                \Magento\Framework\ObjectManagerInterface $objectManager,
                                \QaisarSatti\HelloWorld\Model\HelloworldFactory $helloworld)
    {
        $this->hello = $helloworld;
        $this->_objectManager = $objectManager;
        parent::__construct($context);
    }
    public function execute()
    {
        $post = $this->getRequest()->getPostValue();
        $model = $this->_objectManager->create('QaisarSatti\HelloWorld\Model\Helloworld');
        $model->setData('post_id', $post['post_id']);
        $model->setData('title', $post['title']);
        $model->setData('content', $post['content']);
        $model->save();
        $this->_redirect('*/*/');
        $this->messageManager->addSuccess(__('Your values has beeen submitted successfully.'));
    }

}

```

Model file

QaisarSatti\HelloWorld\Model\Helloworld.php

```
<?php

namespace QaisarSatti\HelloWorld\Model;

    class Helloworld extends \Magento\Framework\Model\AbstractModel  
    {   
        protected function _construct()
        {
            $this->_init('QaisarSatti\HelloWorld\Model\ResourceModel\Helloworld');
        }
    }

```

Resource Module:
QaisarSatti\HelloWorld\Model\ResourceModel\Helloworld.php

```
<?php

namespace QaisarSatti\HelloWorld\Model\ResourceModel;

use \Magento\Framework\Model\ResourceModel\Db\AbstractDb;

class Helloworld extends AbstractDb

{

    protected function _construct()

    {

        $this->_init('sample_posts', 'post_id');

    }

}

```

Collection.php

QaisarSatti\HelloWorld\Model\ResourceModel\Helloworld\Collection.php

```
<?php

namespace QaisarSatti\HelloWorld\Model\ResourceModel\Helloworld;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;

class Collection extends AbstractCollection

{

    protected function _construct()
    {

        $this->_init(
        'QaisarSatti\HelloWorld\Model\Helloworld',
        'QaisarSatti\HelloWorld\Model\ResourceModel\Helloworld');

    }

}

```

Setup\InstallSchema.php

```
<?php

namespace QaisarSatti\HelloWorld\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;

class InstallSchema implements InstallSchemaInterface {

    public function install( SchemaSetupInterface $setup, ModuleContextInterface $context ) {
        $installer = $setup;

        $installer->startSetup();

        $table = $installer->getConnection()->newTable(
            $installer->getTable( 'sample_posts' )
        )->addColumn(
            'post_id',
            Table::TYPE_SMALLINT,
            null,
            [ 'identity' => true, 'nullable' => false, 'primary' => true ],
            'Post ID'
        )->addColumn(
            'title',
            Table::TYPE_TEXT,
            255,
            [ 'nullable' => false ],
            'Post Title'
        )->addColumn(
            'content',
            Table::TYPE_TEXT,
            '2M',
            [ ],
            'Post Content'
        )->setComment(
            'Sample Post Table'
        );

        $installer->getConnection()->createTable( $table );

        $installer->endSetup();
    }
}

```

I can able to get the values from frontend phtml file using the method `getPostValue()`. But I can't able to save it. I like to save the values which I get from `getpostvalue()` method to the database. Please help me.