herghost Posted January 2, 2009 Share Posted January 2, 2009 Hi All, I am trying to do something that I thought would be simple, but now I just cant work it out! I have a table and with a coloum 'name' and I am simply trying to add data into the 'name' filled while leaving the other fields blank. I have tried this, which I thought would do it: INSERT INTO class_categories (`name`) VALUES ('AC', 'AIXAM', 'ALFA ROMEO', 'ASCARI', 'ASIA', 'ASTON MARTIN', 'AUBURN', 'AUDI', 'AUSTIN', 'BELSIZE', 'BENTLEY', 'BITTER', 'BMW','BRISTOL','BUGATTI','BUICK','CADILLAC','CATERHAM','CHEVROLET','CHRYSLER','CITROEN','COLEMAN MILNE','CORVETTE','DAEWOO','DAIHATSU','DAIMLER','DATSUN','DAX','DE TOMASO','DODGE','EXCALIBUR','FERRARI','FIAT','FORD','GINETTA','GMC','HILLMAN','HOLDEN','HONDA','HUMMER','HYUNDAI','INFINITI','ISUZU','JAGUAR','JEEP','JENSEN','KIA','KOENIGSEGG','LADA','LAMBORGHINI','LANCIA','LAND ROVER','LEXUS','LIGIER','LINCOLN','LOTUS','LTI','MARCOS','MARLIN','MASERATI','MAYBACH','MAZDA','MCLAREN','MERCEDES-BENZ','MERCURY','MG','MICROCAR','MINI','MITSUBISHI','MITSUOKA','MORGAN','MORRIS','NAYLOR','NISSAN','NOBLE','OPEL','PAGANI','PANTHER','PERODUA','PEUGEOT','PGO','PILGRIM','PLYMOUTH','PONTIAC','PORSCHE','PROTON','QUANTUM','RADICAL','RELIANT','RENAULT','ROLLS-ROYCE','ROVER','SAAB','SEAT','SEBRING','SKODA','SMART','SSANGYONG','SUBARU','SUNBEAM','SUZUKI','TALBOT','TATA','TD CARS','TIGER','TOYOTA','TRIUMPH','TVR','ULTIMA','VAUXHALL','VENTURI','VOLKSWAGEN','VOLVO','WESTFIELD','WOLSELEY') but I just get the error '#1136 - Column count doesn't match value count at row 1 ' There are 115 enteries to I tried creating the 115 rows and then using the REPLACE into command but got the same thing. Any pointers would be welcome Quote Link to comment https://forums.phpfreaks.com/topic/139197-solved-very-simple-insert-query/ Share on other sites More sharing options...
Mchl Posted January 2, 2009 Share Posted January 2, 2009 INSERT INTO class_categories (`name`) VALUES ('AC'), ('AIXAM'), ('ALFA ROMEO'), ... ('WOLSELEY') (The way you tried it, MySQL thought you wanted to insert all this into a single row) Quote Link to comment https://forums.phpfreaks.com/topic/139197-solved-very-simple-insert-query/#findComment-728056 Share on other sites More sharing options...
herghost Posted January 2, 2009 Author Share Posted January 2, 2009 Dammit! So Simple! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/139197-solved-very-simple-insert-query/#findComment-728201 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.