G.SQLStr
From GMod Wiki
Revision as of 19:25, 11 November 2009 by Crazy Quebecer (Talk | contribs)
Function | |
Syntax |
SQLStr( String value ) Where is this used? |
Description: | |
Returns a string value that is safe to insert into an SQL statement | |
Returns: | String |
Part of Library: | Global Functions |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.SQLStr]G.SQLStr [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Additional Notes
- Escapes double quotes and surrounds the value in double quotes.
- This should be used ANYWHERE that a string is inserted into an SQL statement. Otherwise, at best, you query will fail and, at worst, someone can modify or corrupt your data.
- Not using this could result in SQL Injection.