Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-03-2010, 12:05 PM
reddogut
Sarnak
 
Join Date: Jun 2007
Posts: 83
Default Help with MySQL commands

Can someone help me with the syntax on a couple MySQL commands?

I want to reset the hit points on all mobs/NPC's within a set level range. For example all mobs/NPC's between levels 1 and 10 get set to 10 hit points.

UPDATE npc_types SET HP = 10 WHERE LEVEL ??????

I want to be able to search the items table for all items containing a set of characters. For example, I want to search for all items with the word 'boots' in the name.

SELECT * FROM items WHERE NAME = 'boots';

But I know that = doesn't work unless I have the exact name, like 'steel toed boots'.

Thanks!
__________________
-Red Dog
My Windows Server install guide - http://www.eqemulator.net/wiki/wikka.php?wakka=Windows
My guide for configuring a solo-able server - http://www.eqemulator.net/wiki/wikka.php?wakka=How
Reply With Quote
  #2  
Old 06-03-2010, 01:08 PM
Andrew80k
Dragon
 
Join Date: Feb 2007
Posts: 659
Default

Now this is UNTESTED and since I don't have the table definitions in front of me I can't guarantee that this is correct. This is the syntax for updating a range.

UPDATE npc_types SET HP = 10 WHERE LEVEL >= 1 and LEVEL <= 10;
Reply With Quote
  #3  
Old 06-03-2010, 01:40 PM
pfyon's Avatar
pfyon
Discordant
 
Join Date: Mar 2009
Location: Ottawa
Posts: 495
Default

Code:
select * from items where name like '%boots%';
The % act as wildcards. Also note that if your mysql db is on a linux system, the names will be case sensitive (so boots would match 'Journeyman's boots' but not 'Journeyman's Boots' for example).
Reply With Quote
  #4  
Old 06-03-2010, 11:02 PM
reddogut
Sarnak
 
Join Date: Jun 2007
Posts: 83
Default

Thanks for the replies everyone.
__________________
-Red Dog
My Windows Server install guide - http://www.eqemulator.net/wiki/wikka.php?wakka=Windows
My guide for configuring a solo-able server - http://www.eqemulator.net/wiki/wikka.php?wakka=How
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 10:55 PM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3