Skip to content

Conversation

@Jujhar
Copy link

@Jujhar Jujhar commented Oct 17, 2014

This can be helpful if the first column is not primary key.

I tested both command and imported the scripts

  • php csv_to_sql.php inputfile.csv outputfile.sql database_name
  • php csv_to_sql.php inputfile.csv outputfile.sql database_name --nopk
    and both are working flawless.

This is the output of the file with --nopk specified:

CREATE TABLE test.test2 (
990 VARCHAR(3),
LIMA VARCHAR(4)
) DEFAULT CHARACTER SET 'utf8';

INSERT INTO test.test2 VALUES('991', 'LIMA');
INSERT INTO test.test2 VALUES('992', 'LIMA');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant