Garry's Mod Wiki

sql.LastError

string sql.LastError()

Description

Returns the last error from a SQLite query.

Returns

1 string
error

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(t,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.

Page Links


Special Pages


Wikis

?

Render Time: 33ms

DB GetPage 5
Generate Html 4
SaveChanges (1) 10
Render Body 0
Render Sidebar 12