Welcome Guest, Not a member yet? Register   Sign In
Insert db and Error Number: 1054
#1

[eluser]zimco[/eluser]
I've seen other threads in the forum related to this error and cannot discern if it is: a CI bug, or according to some other threads i'm trying to do something using active records insert that i'm not allowed to do and by reading the user's manual i should see what it is i have done wrong. However, i'm not seeing it. So how can i do a simple insert of an array of values into my database?

In my controller i have done this
Code:
$event=array();
$event=$data['conditions'];
$this->insert_event($event);
the function insert_event
Code:
function insert_event($event) {
  $this->load->database();
        print_r($event);
        $this->db->insert('race_events', $event);
    }

Which results in this:
Array ( [0] => 15 [1] => 03/26/1998 [2] => RACE TRACK [3] => $ 500 [4] => NW12501L6 [5] => SLOW [6] => Evening [7] => 1 Mile [8] => FT [9] => 56.0 [10] => 9 )

An Error Was Encountered

Error Number: 1054

Unknown column '0' in 'field list'

INSERT INTO `race_events` (`0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`) VALUES ('15', ' 03/26/1998 ', ' RACE TRACK ', '$ 500', 'NW12501L6', 'SLOW', ' Evening ', '1 Mile', 'FT', '56.0 ', '9')


Messages In This Thread
Insert db and Error Number: 1054 - by El Forum - 03-27-2008, 02:33 PM
Insert db and Error Number: 1054 - by El Forum - 03-27-2008, 03:11 PM
Insert db and Error Number: 1054 - by El Forum - 03-27-2008, 06:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB