Forum Moderators: coopster
I usually do the same, one extra column in my db that is not in my csv called table_id or something. I then do my inserts like so
insert into tablename values ('',$csvcol1,$csvcol2,$csvcol3,$csvcol4);
where the quotes at the beginning are for the auto increment field.
My guess would be that something else is going wrong if the auto increment isn't working.
Look again at jatar_k's example. He's not populating that field with anything.
insert into tablename values (' ',$csvcol1,$csvcol2,$csvcol3,$csvcol4);
Most of my tables have the first field defined with the name of 'recid' and set as Primary with auto increment on. When I add a record I never include the field 'recid' in my statement. The field 'recid' becomes useful when I want to update or delete a row in my table.