To import a csv file to mysql, do you need to create a new table? I have a CSV file to import it to mysql. do you need to create a table first and then create a new field, I tried to create a table, created a field, and imported it with phpmyadmin. An error occurred. The message is InvalidfieldcountinCSVinputonline1. I don't know why ~ I just got started. thank you for importing the csv file into mysql. do you need to create a new table?
I have a CSV file that needs to be imported into mysql. Do I need to create a table first and then create a field? I tried to create a table and a field myself, then use phpmyadmin to import the data, and an error occurs. The message displayed is Invalid field count in CSV input on line 1.
I don't know why ~ Excuse me, thank you.
Oh, none of them can insert attachments, but they can have external links... Isn't it?
------ Solution --------------------
$ Con = mysql_connect ("localhost", "peter", "abc123 ");
If (! $ Con)
{
Die ('could not connect: '. mysql_error ());
}
// Create database
If (mysql_query ("create database my_db", $ con ))
{
Echo "Database created ";
}
Else
{
Echo "Error creating database:". mysql_error ();
}
// Create table
Mysql_select_db ("my_db", $ con );
Mysql_query ("set names utf8 ");
$ SQL = "CREATE TABLE name
(
PartyID varchar (60 ),
Fully NAME varchar (100 ),
Local NAME varchar (100 ),
... // All columns in CVS
)";
// Execute query
Mysql_query ($ SQL, $ con );
Mysql_close ($ con );
?>
------ Solution --------------------
Invalid field count in CSV input on line 1.
The input field in the CSV file of 1 rows is invalid.
Make sure that the data type of G is correct!
The first line (the title line) should be skipped during import)