Multiple mysql injections

  • Danny1337
  • Student
  • Student
  • Danny1337
  • Posts: 70
  • Loc: Norway

Post 3+ Months Ago

Okay, so I have a large amount of data I need to insert. All of these are seperated by comma. I need to insert every single of these on seperate rows in a table. It's more than 5000, and I just have them in a .txt file at the moment.
Is it possible? or will I need to manually insert every single one?
This is how the data i need to insert looks like:

Nintendo,Super Nintendo,Nintendo 64,Nintendo GameCube,Nintendo Wii ...


The table just need two columns; id (with auto increasement), and Name.

thanks for your time
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Don2007
  • Web Master
  • Web Master
  • Don2007
  • Posts: 4924
  • Loc: NY

Post 3+ Months Ago

Search Google for:

import text to sql server
  • Danny1337
  • Student
  • Student
  • Danny1337
  • Posts: 70
  • Loc: Norway

Post 3+ Months Ago

I don't think that's quite what I need. I mean importing all the data into mysql so I can use them on a website

The data I have goes on like this (i had to seperate them using semicolon instead of comma, because some of them had comma in their name)
Code: [ Select ]
1080: TenEighty Snowboarding;A Bug's Life;Aero Fighters Assault;AeroGauge;Aidyn Chronicles: The First Mage;All Star Tennis '99;All-Star Baseball '99;All-Star Baseball 2000;All-Star Baseball 2001;Armorines: Project S.W.A.R.M.;Army Men: Air Combat;Army Men: Sarge's Heroes;Army Men: Sarge's Heroes 2;Asteroids Hyper 64;Automobili Lamborghini;Banjo-Kazooie;Banjo-Tooie;Bassmasters 2000;Batman Beyond: Return of the Joker;BattleTanx;BattleTanx: Global Assault;Battlezone: Rise of the Black Dogs;Beetle Adventure Racing;Big Mountain 2000;Bio F.R.E.A.K.S.;Blast Corps;Blues Brothers 2000;Body Harvest;Bomberman 64;Bomberman 64: The Second Attack!;Bomberman Hero;Bottom of the 9th;Brunswick Circuit Pro Bowling;Buck Bumble;Bust-A-Move '99;Bust-A-Move 2 Arcade Edition;California Speed;Carmageddon 64;Castlevania;Castlevania: Legacy of Darkness;Chameleon Twist;Chameleon Twist 2;Charlie Blast's Territory;Chopper Attack;ClayFighter 63 1/3;ClayFighter: The Sculptor's Cut;Command & Conquer;Conker's Bad Fur Day;Cruis'n Exotica


I want each of them into a table, like this:
Code: [ Select ]
CREATE TABLE `games` (
 `id` int(1) NOT NULL auto_increment,
 `game` longtext NOT NULL,
 PRIMARY KEY (`id`),
 UNIQUE KEY `id` (`id`),
 KEY `id_2` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;


INSERT INTO `games` VALUES(1, '1080: TenEighty Snowboarding');
INSERT INTO `games` VALUES(2, 'A Bug''s Life');
INSERT INTO `games` VALUES(3, 'Aero Fighters Assault');
  1. CREATE TABLE `games` (
  2.  `id` int(1) NOT NULL auto_increment,
  3.  `game` longtext NOT NULL,
  4.  PRIMARY KEY (`id`),
  5.  UNIQUE KEY `id` (`id`),
  6.  KEY `id_2` (`id`)
  7. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
  8. INSERT INTO `games` VALUES(1, '1080: TenEighty Snowboarding');
  9. INSERT INTO `games` VALUES(2, 'A Bug''s Life');
  10. INSERT INTO `games` VALUES(3, 'Aero Fighters Assault');
  • Don2007
  • Web Master
  • Web Master
  • Don2007
  • Posts: 4924
  • Loc: NY

Post 3+ Months Ago

I'll have to defer to someone else. I don't build web sites.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

http://dev.mysql.com/doc/refman/5.5/en/load-data.html

You'll want to pay special attention to the LINES [STARTED|TERMINATED] BY clauses.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 135 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.