Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So basically you want to tell mysql which columns of the table you give in the csv? That is easy using <a href="http://dev.mysql.com/doc/refman/5.1/de/load-data.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.1/de/load-data.html</a>, you just give the columns you want to insert in () at the end of the statement. Since you don't give the table structure I have to guess.</p> <pre><code>LOAD DATA LOCAL INFILE '$datei' INTO TABLE empfaenger FIELDS TERMINATED BY '$spaltentrennzeichen' LINES TERMINATED BY '\n' IGNORE 1 LINES (empfaenger_name, $value_column_name ) set empfaenger_id = null ; </code></pre> <p>The csv has how many and which columns, the table has which cols? If you give those infos you will get a better answer. </p> <p>EDIT: To throw away the non-needed columns you just put them into variables.</p> <p>(@somecol0, @somecol1, @somecol2, email)</p> <p>EDIT2:</p> <p>If the table has columns <code>empfaenger_id, email, phone</code>. The csv is given as (empfaenger_id, email) then the statement would be </p> <pre><code>LOAD DATA LOCAL INFILE '$datei' INTO TABLE empfaenger FIELDS TERMINATED BY '$spaltentrennzeichen' LINES TERMINATED BY '\n' IGNORE 1 LINES (empfaenger_id, email ) # that line is variable! ; </code></pre> <p>If you web page says, that the csv is empfaenger_id, phone, the statement is </p> <pre><code>LOAD DATA LOCAL INFILE '$datei' INTO TABLE empfaenger FIELDS TERMINATED BY '$spaltentrennzeichen' LINES TERMINATED BY '\n' IGNORE 1 LINES (empfaenger_id, phone ) # that line is variable! ; </code></pre> <p>You just have to create (after user-submit) a list of the column-names in your SQL-Table for the columns of the csv.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload