ohdang888 Posted April 5, 2009 Share Posted April 5, 2009 i have a file called list.csv (below), and i am uploading it into a table with this structure: id, fn, ln, user_id, updated when i try to upload my .scv file through php my admin, i upload it, click "CSV" and for column names put "fn, user_id" and click upload. And its returning the following error: Invalid field count in CSV input on line 1. Whats wrong? Thanks! list.csv: Bob, 345275 Tim, 2547354 Test, 5763 Quote Link to comment https://forums.phpfreaks.com/topic/152685-upload-to-phpmyadmin-with-csv/ Share on other sites More sharing options...
unrelenting Posted April 5, 2009 Share Posted April 5, 2009 You probably need to have data for every column in your csv file. Something like: 1, 1, 1, Bob, 345275 2, 2, 2, Tim, 2547354 3, 3, 3, Test, 5763 Or just make the table with only 2 columns, import the csv file and then go back in and add the other columns. Quote Link to comment https://forums.phpfreaks.com/topic/152685-upload-to-phpmyadmin-with-csv/#findComment-801805 Share on other sites More sharing options...
SPraus Posted April 5, 2009 Share Posted April 5, 2009 If you would like to keep the data null for the other sections insert something like this ,,,Bob,345275 ,,,Tim,2547354 ,,,Test,5763 Quote Link to comment https://forums.phpfreaks.com/topic/152685-upload-to-phpmyadmin-with-csv/#findComment-801819 Share on other sites More sharing options...
ohdang888 Posted April 5, 2009 Author Share Posted April 5, 2009 but its worked before this way Quote Link to comment https://forums.phpfreaks.com/topic/152685-upload-to-phpmyadmin-with-csv/#findComment-801865 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.