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 8056141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:37:00+00:00 2026-06-05T08:37:00+00:00

I am new to codeigniter where I tried form validation. Here is my View

  • 0

I am new to codeigniter where I tried form validation.

Here is my View Code:

<?php echo validation_errors(); ?>
          <?php echo form_open('enquiry'); ?>
          <table width="580" border="0" cellspacing="0" cellpadding="5">

            <tr>
              <td height="30" align="right" valign="middle" class="normal-text-style"> *Full Name:<br /></td>
              <td height="30" align="left" valign="middle" class="normal-style"><input type="text" name="name" value="<?php echo set_value('name'); ?>" class="textbox-style01" /></td>
            </tr>
            <tr>
              <td height="30" align="right" valign="middle" class="normal-text-style"> *Company: <span id="mndCompany"> </span><br /></td>
              <td height="30" align="left" valign="middle" class="normal-style"><input type="text" name="company" value="<?php echo set_value('company'); ?>"  class="textbox-style01" /></td>
            </tr>
            <tr>
              <td height="30" align="right" valign="middle" class="normal-text-style"> *E-mail:</td>
              <td height="30" align="left" valign="middle" class="normal-style"><input type="text" name="email" value="<?php echo set_value('email'); ?>" class="textbox-style01" /></td>
            </tr>
            <tr>
              <td height="30" align="right" valign="middle" class="normal-text-style"> *Phone: <br /></td>
              <td height="30" align="left" valign="middle" class="normal-style"><input type="text" name="phone" value="<?php echo set_value('phone'); ?>" class="textbox-style01" /></td>
            </tr>
            <tr>
              <td height="30" align="right" valign="middle" class="normal-text-style"> *Fax: <br /></td>
              <td height="30" align="left" valign="middle" class="normal-style"><input type="text" name="fax" value="<?php echo set_value('comments'); ?>" class="textbox-style01" /></td>
            </tr>
            <tr>
              <td width="179" height="30" rowspan="2" align="right" valign="top" class="normal-text-style"> *Comments: <br /></td>
              <td width="421" height="12" align="left" valign="middle" class="normal-style"><textarea  name="comments" class="msgebox-style01"><?php echo set_value('comments'); ?></textarea></td>
            </tr>
            <tr>
              <td height="50" align="left" valign="top" class="normal-style"><input type="image" name="submit" src=" <?php echo base_url(); ?>/public/images/submit01.png" alt="submit" /></td>
            </tr>
          </table>
          </form>

And this is my controller

function index()
    {
        $this->form_validation->set_rules('name', 'Name', 'trim|required|xss_clean');
        $this->form_validation->set_rules('company', 'Company', 'trim|required|xss_clean');
        $this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]');
        $this->form_validation->set_rules('phone', 'phone', 'trim|required|xss_clean');
        $this->form_validation->set_rules('fax', 'fax', 'trim|required|xss_clean');
        $this->form_validation->set_rules('comments', 'comments', 'trim|required|xss_clean');


        $data['header_menu']=$this->load->view('header_menu', '', TRUE);
        $this->load->view('inner_header',$data);
        $data['left_menu']=$this->load->view('left_menu', '', TRUE);

        if ($this->form_validation->run() == FALSE)
        {
            $this->load->view('enquiry',$data);
        }

        else
        {
           $this->load->view('enquiry/formsucess',$data);   
        }    
        $this->load->view('footer');
        //$this->load->view('enquiry',$data);


    }
    function formsucess()
    {


        $name = $this->input->post('name');
        $company = $this->input->post('company');
        $email = $this->input->post('email');
        $phone = $this->input->post('phone');
        $fax = $this->input->post('fax');
        $comments = $this->input->post('comments');
        $this->db->query("INSERT INTO `st_enquiry` 
        (name, company,email,phone,fax,comments,status,created_on)
        VALUES
        ('$name','$company','$email','$phone','$fax','$comments','1',now())");

        $data['header_menu']=$this->load->view('header_menu', '', TRUE);
        $this->load->view('inner_header',$data);
        $data['left_menu']=$this->load->view('left_menu', '', TRUE);
        $this->load->view('media',$data);
        $this->load->view('footer');


    }

After submitting the form I got an error like:

A Database Error Occurred

Error Number: 1146

Table 'table.users' doesn't exist
  • 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-05T08:37:01+00:00Added an answer on June 5, 2026 at 8:37 am

    checkout this link

    Here

    $data = array(
       'title' => 'My title' , // column_name => value
       'name' => 'My Name' ,
       'date' => 'My date'
    );
    
    $this->db->insert('tablename', $data);
    

    must work in any condition.

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

Sidebar

Related Questions

Hey I'm new to php and codeigniter. I know that in codeigniter's view you
I am new to the Codeigniter.How to store the form values in mysql using
I am new to PHP Codeigniter framework. I am designing a page in which
I'm new to PHP/MySQL and super-new to CodeIgniter.. I have information in many MySQL
EDIT: I am using Code Igniter: www.codeigniter.com So I'm new to web developement and
i have download the new codeigniter 2.0 and put my controller,model and view files
I'm new to codeigniter this is my case: I have a homepage with a
I'm really new to CodeIgniter and am having some trouble getting started. I see
I'm new in codeigniter I have problem I use my OS X Lion, and
Hi I’m just new in codeigniter. My website works locally, but when I uploaded

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.