ya ` works but not '
|
I believe that %' is an escape character in SQL that says to the DB to process it as a ' instead of the end of a string since thats what 's are usually used for. The ' was saying the string was over and the DB couldn't match the normal ' at the end to anything so it failed. You can also do the same thign for a few other special characters, like %% inserts a %. And I could be completely wrong of course, but I do beleive from my SQL class two years ago that is the right way to do it.
|
i used % in mysql as a wildcard character.
Code:
SELECT ALL FROM npc_types WHERE name LIKE '%goblin%'; So if as you said %' was an escape... the above wouldn't in theory work. |
Yeah, my memory was faulty, big suprise. I now remember (with google's help) that SQL uses the standard backslash as the escape character. So you can do \' or whatever to make SQL ignore it and put it into the DB as a quote. This will probably display weirdly when you first spawn the npc, it might show their name as "Bob\'s Cow" until you shut down the zone and restart it because the code will see the \ until it writes to the DB and reads it back, but it should work once the NPC is loaded fromt he DB.
PS I think i remember now that the %% thing came C in printf and scanf methods. Sorry for my brain farts. |
All times are GMT -4. The time now is 03:49 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.