Conjurer Posted November 3, 2003 Share Posted November 3, 2003 How can I update the autonum file when I am loading data from a csv text file? I have Field 2, Field 3, Field 4, etc. in my text file. In the table Field 1 is set up as an autonum Primary key. When I tell it to load the data file using columns 2 - 4 it loads the rows but leaves the first field blank. What would I need to add to the syntax to have it also populate the primary key with the autonum values? :roll: Quote Link to comment https://forums.phpfreaks.com/topic/1274-load-data-from-file-into-table-that-has-autonum-primary-key/ Share on other sites More sharing options...
shivabharat Posted November 7, 2003 Share Posted November 7, 2003 Make the field auto increment Here is an example taken from the manual CREATE TABLE animals ( id MEDIUMINT NOT NULL AUTO_INCREMENT, name CHAR(30) NOT NULL, PRIMARY KEY (id) ); Quote Link to comment https://forums.phpfreaks.com/topic/1274-load-data-from-file-into-table-that-has-autonum-primary-key/#findComment-4360 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.