query string length should be...?
#1

Query string length should be the count of characters used in the query as it is in the script, or the count of characters which will be once those values are replaced by actual values?

For example

%s - 2 characters, but that could be replaced with 'Unknown' which is 7 characters
Reply
#2

Replace each holder (%s, %d, %i, %f, whatever) by the maximum values it can hold.
For an integer, it's -2000000000 (almost, but it's the length of the text that counts, not the value itself), so for an int, it's 11 characters.
For a string, it can be longer than that.
If it's only used to hold a player's name, provide space for 24 characters.
If you're saving messages for the chat, use 144 characters.
If you save a plate for a vehicle, it's only 7 characters.

I do it by copying the text into Notepad, then replace each holder by their max values and then put the cursor at the last character to see the length of the string.
Reply
#3

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)