[SC.LUG] More MySQL (than you'd care to shake a stick at!

Simeon Farrington swfarrington at beeb.net
Tue Aug 17 22:22:21 BST 2004


> 
> Message: 1
> Date: Tue, 17 Aug 2004 10:01:04 +0100
> From: "nev" <nev at digital-thought.net>
> Subject: Re: [SC.LUG] More MySQL (than you'd care to shake a stick
> 	at)!
> To: South Cheshire GNU/Linux Users <sc at mailman.lug.org.uk>
> Message-ID: <20040817090104.M46832 at digital-thought.net>
> Content-Type: text/plain; charset=iso-8859-1
> 
> hiya
> 
> i dont know how you are formatting your sql text file, but it should be along
> the lines of the following table. this is one i actually used, so i know it works.
> 
> #
> # Table structure for table `certs`
> #
> 
> CREATE TABLE certs (
>   certid bigint(6) NOT NULL auto_increment,
>   userid varchar(16) NOT NULL default '',
>   userpdf varchar(64) NOT NULL default '',
>   PRIMARY KEY  (certid,userid,userpdf)
> ) TYPE=MyISAM;
> 
> #
> # Dumping data for table `certs`
> #
> 
> INSERT INTO certs VALUES (32, '38', '0207001.pdf');
> INSERT INTO certs VALUES (41, '22', '0206130.pdf');
> INSERT INTO certs VALUES (42, '22', '0206129.pdf');
> 
> ========
> 
> you dont have to have 'create' and insert in the same document though, obviously.
> 
> hope this helps :)
> 
> nev
> 

I thought of doing it that way, but unfortunately the table in question 
has about 6000 rows of data in it and not a sql file itself but instead 
the raw data to be inserted into the (already created) table. Therefore, 
unless there's a really quick and automated way of converting to the 
above, I'd rather not have to amend the file for all records! eg the 
first couple of records:

"Abbey Dore","Herefs","Holy Trinity & S Mary",6.00,,,"9¼cwt in Aflat. 
Anti-clockwise. SO387303"
"Abbots Bromley","Staffs","S Nicholas",8.00,,,"11-1-5 in G. Tue SK079245"
"Abbots Langley","Herts","S Lawrence",6.00,,,"9-2-25 in F#. Mon TL095022"
"Abbots Leigh","Som","Holy Trinity",6.00,,,"14cwt in F#. Thu ST544740"
"Abbotsbury","Dorset","S Nicholas",6.00,,,"9-3-1 in G#. Wed SY577852"
"Abbotsham","Devon","S Helen (GF)",6.00,,,"10-3-22 in G. Wed SS424264"

(this is just a practice exercise, I don't actually need to upload this 
table as I've done this form the commandline - I just want to know how I 
can take the same data in via phpmyadmin as this is how my ISP works (or 
doesn't in this instance!!!)

Any ideas?

Ta Simeon




More information about the SC mailing list