Garry's Mod Wiki

Garry's Mod Wiki

  string sql.LastError()

Description

Returns the last error from a SQLite query.

Returns

1 string
Last error from SQLite database.

Example

Reports all SQL errors into console automatically. Can help on debugging or testing.

sql.m_strError = nil -- This is required to invoke __newindex setmetatable( sql, { __newindex = function( table, k, v ) if ( k == "m_strError" and v and #v > 0 ) then print("[SQL Error] " .. v ) end end } )
Output: After running sql.Query("SELECT") will print [SQL Error] incomplete input in the console.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...