Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Tanetti
Newbie


Joined: 01 Nov 2006
Posts: 8

PostPosted: Fri Jan 11, 2008 5:30 am   

Mapquery - and room name variable
 
I have a variable that changes based on a quest room that I need to visit, and can store that with a series of pattern matching triggers.

My problem is that some of the room names contain an apostrophe, but the SQL/Zmud combo interprets the apostrophe within the room name variable as the ending apostrophe right before the close bracket below.

#MAPQUERY {[Name] LIKE '@akroomloc'}


When the stored variable is: My room - it works fine.
When the stored variable is: Tanetti's room - it errors out.

How am I supposed to use a variable inside of the #Mapquery function, so the whole variable gets used?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jan 11, 2008 5:38 am   
 
You need to double the single quotes.
Code:
#MAPQUERY {%concat("[NAME] LIKE '",%replace(@akroomloc,"'","''"),"'")}

_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Tanetti
Newbie


Joined: 01 Nov 2006
Posts: 8

PostPosted: Fri Jan 11, 2008 5:52 am   
 
it's works!!! you must be a GURU or something... oh wait, ya are! Thanks bunches!
Reply with quote
Rtoo
Beginner


Joined: 30 Jul 2009
Posts: 11

PostPosted: Fri Jul 31, 2009 4:02 pm   
 
I am trying to do something simular to this. I want to query the roomid (or short name). I tried using Roomid but I keep getting errors.

Any suggestions?
Reply with quote
Rtoo
Beginner


Joined: 30 Jul 2009
Posts: 11

PostPosted: Thu Aug 06, 2009 5:05 pm   
 
Vijilante wrote:
You need to double the single quotes.
Code:
#MAPQUERY {%concat("[NAME] LIKE '",%replace(@akroomloc,"'","''"),"'")}


This works great, but how would you add in an AND statement to narrow down the search by zone?

I have tried to add an AND statement, but I keep getting errors.

Also, there are some rooms that have (G) or [**> PK <**] and (G) [**> PK <**] at the end of the room name. This query doesn't see them, but using find on the mapper does bring them up.

So long story short, I am looking for a querry that can include room names that have (G) and/or [**> PK <**], and will only look in the current zone that I am in.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net