+ Reply to Thread
Results 1 to 2 of 2

Thread: MySQL MASS insert

  1. #1
    olliepop's Avatar
    olliepop is offline x10 Sophmore olliepop is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    137

    MySQL MASS insert

    Hi, how would i insert a file with a format like this:
    0 0 0 0
    0 1 0 0
    0 2 0 0
    0 3 0 0
    0 4 0 0
    0 5 0 0
    0 6 0 0
    0 7 0 0
    0 8 0 0
    0 9 0 0
    0 10 0 0
    0 11 0 0
    0 12 0 0
    0 13 0 0
    0 14 0 0
    0 15 0 0
    0 16 0 0
    0 17 0 0
    0 18 0 0
    0 19 0 0
    0 20 0 0
    directly into the database? The table i need to insert this MASSIVE file into has four columns, represented by each number in the file.

    How would i do it without the painful INSERT INTO table_name (column1, column2, column3,...)
    VALUES (value1, value2, value3,...)

  2. #2
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: MySQL MASS insert

    Just read line by line, explode() it on " " and repeat until you reach the end of the file.
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

+ Reply to Thread

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 43
    Last Post: 03-24-2011, 07:27 AM
  2. Replies: 14
    Last Post: 09-29-2008, 07:07 PM
  3. New Site-Suggestions?
    By mnoutside in forum Review My Site
    Replies: 9
    Last Post: 08-27-2008, 07:01 AM
  4. INSERT command denied??
    By 1337scape in forum Free Hosting
    Replies: 6
    Last Post: 11-14-2007, 05:15 PM
  5. Have a problem with my forum
    By tikloos in forum Scripts & 3rd Party Apps
    Replies: 43
    Last Post: 01-19-2006, 01:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers