Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:22:31+00:00 2026-06-03T10:22:31+00:00

I am new to the Codeigniter.How to store the form values in mysql using

  • 0

I am new to the Codeigniter.How to store the form values in mysql using codeigniter ,Can any one help me…Is there any links Can you provide….
Thanks In Advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:22:33+00:00Added an answer on June 3, 2026 at 10:22 am

    Let me clearify you in an easy way…

    This will be your controller

    class Site extends CI_Controller
    {
    function index()
    {
    $this->load->view('form.php');// loading form view
    }
    
    function insert_to_db()
    {
    $this->load->model('site_model');
    $this->site_model->insert_to_db();
    $this->load->view('success');//loading success view
    }
    }
    

    This will be your views. Befor creating views go to autoload.php and autoload url helper and database class.
    In your config.php set config[‘base_url’] = “path to your site”;
    form.php

    <form action="<?php echo base_url();?>index.php/site/insert_into_db" method="post">
    Field 1 = <input type = 'text' name='f1'>
    Field 2 = <input type = 'text' name='f2'>
    Field 3 = <input type = 'text' name='f3'>
    <input type='submit'>
    </form>
    

    success.php

    <b>Your data has been inserted!!!</b>
    

    In your model you need to pull those datas of form and insert into db this way

    site_model.php

    class Site_model extends CI_Model
    {
    function insert_into_db()
    {
    $f1 = $_POST['f1'];
    $f2 = $_POST['f2'];
    $f3 = $_POST['f3'];
    $this->db->query("INSERT INTO tbl_name VALUES('$f1','$f2','$f3')");
    }
    }
    

    In this case your database has three fields… modify query as per your requirements

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new with codeigniter. Hope can help to solve problem on codeigniter pagination.
I am new to PHP codeigniter, how to get checkbox values using php Codeigniter
I am planning a new website with codeigniter using wordpress. this site will contain
I'm new to MVC (I'm using codeigniter) and was wondering where I should put
Im new to codeigniter and php, mysql and i am making a codeigniter app,
I am new to Codeigniter and using Codeigniter 1.7, I created a .htaccess file
I am using codeigniter's session class to handle my PHP sessions. One of the
hi i am new at codeigniter. i want to change my div tag using
I am pretty new to codeigniter. I do know php. How can I accomplish
I'm thinking about using CodeIgniter for a new project. I was reading the user-guide

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.