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

04-20-2004, 08:59 AM
|
 |
Dragon
|
|
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
|
|
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 ?
__________________
|

04-20-2004, 09:11 AM
|
Developer
|
|
Join Date: Feb 2004
Location: UK
Posts: 1,540
|
|
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 ?
|

04-20-2004, 09:50 AM
|
 |
Dragon
|
|
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
|
|
YOU are the man !
Thanks alots 
__________________
|

04-21-2004, 12:25 AM
|
 |
Dragon
|
|
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
|
|
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.
__________________
|

04-21-2004, 01:14 AM
|
Developer
|
|
Join Date: Feb 2004
Location: UK
Posts: 1,540
|
|
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.
|

04-21-2004, 01:20 AM
|
 |
Dragon
|
|
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
|
|
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
__________________
|

04-21-2004, 06:48 AM
|
 |
Dragon
|
|
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
|
|
i cant enter "INSERT INTO ...' because mysql dont take the whole line. look like its restricted to a certain number of characters ...
__________________
|

04-21-2004, 06:56 AM
|
Developer
|
|
Join Date: Feb 2004
Location: UK
Posts: 1,540
|
|
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>'
|
Thread Tools |
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 01:51 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |