View Single Post
  #5  
Old 04-21-2004, 01:14 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I am not sure this is what you want, but ...

If you want to insert 10 new items based on an existiing item, use mysqldump to dump the record you want, in this example, item number 1001:

mysqldump -u root eq items --where 'id=1001' >mytems.txt

If you look in myitems.txt, you will have the SQL to create the item table (which you can delete), followed by an INSERT statement, e.g.

INSERT INTO items VALUES (1001,0,'Cloth Cap',0,2,0,0,0,0, ......

Copy and paste this statement as many times as you like, changing the ID to something unique, and changing the item name and whatever other fields you want.

Then just source the file into mysql.
Reply With Quote