sql

From GMod Wiki

Jump to: navigation, search

Up one category:
Lua
Go to:
Clientside Lua
Go to:
Serverside Lua


The SQL library is an interface to the SQL Lite engine that is built into Garry's Mod.

The syntax and usage of SQL Lite is very similar to MySQL.

This is a better way to save data then direct reading/writing files.

Library Commands

sql.Begin
sql.Commit
sql.LastError
sql.Query
sql.QueryRow
sql.QueryValue
sql.SQLStr
sql.TableExists

Additional Notes

  • Garrys Mod uses two databases to store info.

In the "garrysmod" main folder, there is "sv.db" for the server database, and "cl.db" for the client database.


  • Also, the following site has some very good explanations of the various functions you can use inside the sql.Query function.

http://w3schools.com/sql/default.asp

Personal tools