Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

csv - mysql

Empfohlene Antworten

Ich hab da eine *.csv mit diesem Inhalt:

Jahr;Nr.;Interpret;Titel;;Länge;

2002;1;Las Ketchup;Aserejé (The Ketchup Song);214;03:34;

2002;2;Shakira;Whenever, Wherever;198;03:18;

2002;2;Shakira;Underneath Your Clothes;222;03:42;

.

.

Was hier jetzt rot ist soll nicht in die DB.

Die Tabelle in der DB besteht schon mit den Spalten: Jahr, Nr, Interpret, Titel, zeit.

Wenn ich sage Textdatei laden und mache da alles so wie es eigentlich sein soll, dann bekomme ich nur folgende Meldung ausgegeben.


Datenbank test - Tabelle mp3 auf localhost 

Fehler


SQL-Befehl :  


LOAD DATA LOCAL INFILE 'C:\PHP\uploadtemp\phpE2.tmp' INTO TABLE `mp3` FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\' LINES TERMINATED BY '\r\n' 


MySQL meldet: 



The used command is not allowed with this MySQL version

Zurück 

Was mir sehr komisch vor kommt, ist das immer bei "LOAD DATA LOCAL INFILE" "'C:\PHP\uploadtemp\phpE2.tmp' " angezeigt wird. Die Datei die ich importieren will, aber auf dem Desktop liegt bzw unter E:\blabla.csv

Kann mir mal jemand verraten was ich da falsch mache?

hallo,

Zwei Dinge. Vorneweg das "unwichtige":

1. 'C:\PHP\uploadtemp\phpE2.tmp' ist die per Skript hochgeladene(!) CSV-Datei.

2. Dein eigentliches Problem bezieht sich auf die erste Spalte der Datei. Es ist kein Spaltenname angegeben worden! Du solltest hierfür eine temporäre Tabellle erstellen, die diese Spalte enthält, Lädst die modifizierte CSV-Datei, löschst die unnötige Spalte und fügst die Daten dann in die entgültige tabelle ein.

Eigentlich einfach oder?

mfg

B@S

doppelposting bitte Löschen!

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.