Welcome Guest, Not a member yet? Register   Sign In
Inserting form fields into a database
#4

[eluser]strike312[/eluser]
I am doing the same thing and I have the form fields the same as the columns in the database.

I seem to be getting a problem, the 'submit' is being taken as a column and therefore causing issues.

This is the error:
Quote:Error Number: 1054

Unknown column 'submit' in 'field list'

INSERT INTO `lungs` (`Q1`, `Q2`, `Q3`, `submit`) VALUES ('blach', 'blache', 'blachey', '')

Filename: C:\wamp\www\CI\system\database\DB_driver.php

Line Number: 330


And this is the code in the model:

Code:
$insert= $this->db->insert($dest,$this->input->post());


And the code in the view:

Code:
echo form_input('Q1','Question 1');
echo form_input('Q2','Question 2');
echo form_input('Q3','Question 3');

echo form_submit('submit','submit');


Messages In This Thread
Inserting form fields into a database - by El Forum - 05-18-2010, 05:22 AM
Inserting form fields into a database - by El Forum - 05-18-2010, 05:37 AM
Inserting form fields into a database - by El Forum - 03-25-2011, 01:56 PM
Inserting form fields into a database - by El Forum - 05-19-2011, 04:41 PM
Inserting form fields into a database - by El Forum - 05-19-2011, 04:44 PM
Inserting form fields into a database - by El Forum - 05-20-2011, 02:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB