Garry's Mod Wiki

sql.LastError

sql.LastError

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 then print("[SQL Error] " .. v ) end end } )
Output: After running sql.Query("SELECT") will print [SQL Error] incomplete input in the console.

Special Pages


Wikis

?

Render Time: 21ms

DB GetPage 3
Generate Html 1
SaveChanges (1) 7
Render Body 0
Render Sidebar 7