sql.SQLStr

From GMod Wiki

Jump to: navigation, search
Function
Syntax sql.SQLStr( String str_in )
Where is this used?
Description:
Attempts to make a string safe to pass to a database.
Returns: String
Part of Library: Sql
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Sql.SQLStr]Sql.SQLStr [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionMakes sure there aren't any unescaped quotations before passing to sql.QueryValue
Used onNewerServer.png
Code
local query = "SELECT count(*) from ratings WHERE name = " .. sql.SQLStr( name )
sql.QueryValue( query )
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox