PDA

View Full Version : query problems


GO ILLINI
08-15-2007, 04:24 AM
Our company has been keeping track of product installation ID's and activation ID's. The code below(along with 1000's more enteries) is an attempt to import this data into a mysql table. But I get an 'error in my syntax on line 1'

INSERT INTO `keys` (
`id` ,
`pid` ,
`aid` ,
`bought` ,
`buyer` ,
`active` ,
`notes` ,
`mper`
)
VALUES (NULL,'###-TSS03-P05-C01-S2####-###-####','aid here','07-27-2007','NAME HERE','1','Desktop','12'),
VALUES (NULL,'###-TSS03-P05-C01-S2####-###-####','aid here','07-27-2007','NAME HERE','1','Secondary Reception','12'),
VALUES (NULL,'###-TSS03-P05-C01-S2####-###-####','aid here','07-31-2007','Beth','1','Dell','12'),
VALUES (NULL,'###-TSS03-P05-C01-S2####-###-####','aid here','07-31-2007','Vicki','1','','12'),
VALUES (NULL,'###-TSS03-P05-C01-S2####-###-####','aid here','07-10-2007','Bev','1','','12'),
VALUES (NULL,'###-TSS03-P05-C01-S2####-###-####','aid here','07-10-2007','Bev','1','','12');I have no idea what is wrong and would be grateful if someone got back to me soon and my boss really wants this to be deployed ASAP.

Thanks,
-Adam


PS
id is autonum.
The AID is the same format as PID.
PID is all letters/numbers/-'s the #'s are so you dont steal our product id keys ;)

CFMaBiSmAd
08-15-2007, 05:24 AM
The VALUES keyword is only present once - INSERT statements that use VALUES syntax can insert multiple rows. To do this, include multiple lists of column values, each enclosed within parentheses and separated by commas. Example:

INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);

GO ILLINI
08-16-2007, 06:17 PM
sorry i didnt have time to repost until now.

Thanks,
it works great now...


-Adam