+ Reply to Thread
Results 1 to 4 of 4

Thread: importing data into sql with phpadmin

  1. #1
    Barn Newbie datto510 is an unknown quantity at this point datto510's Avatar
    Join Date
    Apr 2009
    Posts
    2
    Rep Power
    2

    importing data into sql with phpadmin

    I am trying to import some data into a sql database.

    I am using the following sql to make the table

    eg the following script will make a new table.
    Code:
    CREATE TABLE IF NOT EXISTS `est_costcenters` (
      `est_ccorder` int(11) NOT NULL auto_increment,
      `est_cccode` varchar(100) NOT NULL default '',
      `est_ccname` varchar(100) default '',
      `est_ccgl` varchar(100) default '',
      `est_ccgroup` varchar(100) default '',
      `est_ccsecret` varchar(100) default '',
      PRIMARY KEY  (`est_ccorder`)
    ) TYPE=MyISAM;
    
    but not sure how to fill it with required info. (of which there is a a lot)


    Code:
    "ccorder"	"cccode"	"ccname"	"ccgl"	"ccgroup"	"ccsecret"
    1	1000	preliminaries	1.1	prelims	1
    2	2000	site survey	1.1	prelims	1
    3	3000	drafting		1.1	prelims	1
    20	20000	excavation	1.1	slab stage	1
    50	50000	roofing		1.1	enclosed	1
    

  2. #2
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    1,736
    Blog Entries
    10
    Rep Power
    11

    You could try the LOAD DATA command

    MySQL :: MySQL 5.0 Reference Manual :: 12.2.6 LOAD DATA INFILE Syntax

    Don't know if you can do an import using either the Administrator or query browser GUI tools...Available from the MySQL site...MySQL :: MySQL GUI Tools Downloads

  3. #3
    Barn Newbie datto510 is an unknown quantity at this point datto510's Avatar
    Join Date
    Apr 2009
    Posts
    2
    Rep Power
    2

    got an answer on another forum.
    thanks for the responses here.

    Code:
    INSERT 
      INTO est_costcenters
         ( ccorder
         , cccode
         , ccname
         , ccgl
         , ccgroup
         , ccsecret )
    VALUES
     (  1 ,  1000 , 'preliminaries' , '1.1' , 'prelims'    , 1 )
    ,(  2 ,  2000 , 'site survey'   , '1.1' , 'prelims'    , 1 )
    ,(  3 ,  3000 , 'drafting'      , '1.1' , 'prelims'    , 1 )
    ,( 20 , 20000 , 'excavation'    , '1.1' , 'slab stage' , 1 )
    ,( 50 , 50000 , 'roofing'       , '1.1' , 'enclosed'   , 1 )
    

  4. #4
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    1,736
    Blog Entries
    10
    Rep Power
    11

    Quote Originally Posted by datto510 View Post
    got an answer on another forum.
    thanks for the responses here.

    Code:
    INSERT 
      INTO est_costcenters
         ( ccorder
         , cccode
         , ccname
         , ccgl
         , ccgroup
         , ccsecret )
    VALUES
     (  1 ,  1000 , 'preliminaries' , '1.1' , 'prelims'    , 1 )
    ,(  2 ,  2000 , 'site survey'   , '1.1' , 'prelims'    , 1 )
    ,(  3 ,  3000 , 'drafting'      , '1.1' , 'prelims'    , 1 )
    ,( 20 , 20000 , 'excavation'    , '1.1' , 'slab stage' , 1 )
    ,( 50 , 50000 , 'roofing'       , '1.1' , 'enclosed'   , 1 )
    
    Thanks for posting....My mistake, I presumed when you said you were trying to import some data, it was in a file..

+ Reply to Thread

Similar Threads

  1. Replies: 5
    Last Post: June 25th, 2008, 08:07 AM
  2. importing file names based on extension
    By sbenj69 in forum Microsoft Access
    Replies: 1
    Last Post: April 11th, 2008, 12:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO