Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Misc > Archive::Off Topic

Archive::Off Topic Archive area for Off Topic's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2004, 08:59 AM
KhaN's Avatar
KhaN
Dragon
 
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
Default mySQL tip needed

I need to sort item column into a file, like a text file.
Result will be a text file with all items names/ID that i will be able to consult.

It is possible ?
__________________

Reply With Quote
  #2  
Old 04-20-2004, 09:11 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

mysql -u root

use eq;
tee items.txt
select id,name from items;
quit

that will write the id and name field for each item to items.txt

Is that what you are after ?
Reply With Quote
  #3  
Old 04-20-2004, 09:50 AM
KhaN's Avatar
KhaN
Dragon
 
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
Default

YOU are the man !

Thanks alots
__________________

Reply With Quote
  #4  
Old 04-21-2004, 12:25 AM
KhaN's Avatar
KhaN
Dragon
 
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
Default

Another request, is there a way to copy/paste using mySQL command or mySQL Front.

Lemme explain, im making spells, there are 11 spells of the same type, only prefix name change, and editing 11 items is way to long, it could be cool if i can create one, copy/paste the 10 others and just edit the name/ID.

Thanks in advance.
__________________

Reply With Quote
  #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
  #6  
Old 04-21-2004, 01:20 AM
KhaN's Avatar
KhaN
Dragon
 
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
Default

This exactly what i needed, this way i can make on item with "spell template" and just edit ID, Item name, Effect. Faster then editing all items using item editor, especially when you have 2500 spells to write ...

Thanks again Derision

Edit : Tried at home, that dont work ...
Command i type is
Code:
mysqldump -u -root eqa items --where 'id=1102' > items.txt;
Got Error 1064. Tried to change some thigsn, but i cant find.


Edit :LMAO, mysqldump is DOS command. How to lose 2hrs ... geez
__________________

Reply With Quote
  #7  
Old 04-21-2004, 06:48 AM
KhaN's Avatar
KhaN
Dragon
 
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
Default

i cant enter "INSERT INTO ...' because mysql dont take the whole line. look like its restricted to a certain number of characters ...
__________________

Reply With Quote
  #8  
Old 04-21-2004, 06:56 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Just copy and paste the lines in a text file with notepad, make your id and name changes, then save it, go into mysql and type 'source <yourtextfile>'
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:35 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3