mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-03 07:36:23 -07:00
Use boards instead of staff table for sql plugin example
This commit is contained in:
parent
aca2a9abea
commit
ee8af4a2bd
1 changed files with 4 additions and 4 deletions
|
@ -1,12 +1,12 @@
|
|||
event_register({"db-initialized"}, function(tr)
|
||||
print("Testing SELECT query from Lua plugin")
|
||||
rows, err = db_query("SELECT id, username FROM DBPREFIXstaff where id = ?", {1})
|
||||
rows, err = db_query("SELECT id, dir, title FROM DBPREFIXboards where id > ?", {1})
|
||||
if(err ~= nil) then
|
||||
print(err.Error(err))
|
||||
return
|
||||
end
|
||||
|
||||
print("rows.Next():")
|
||||
print("Boards (id > 1):")
|
||||
while rows.Next(rows) do
|
||||
rows_table = {}
|
||||
err = db_scan_rows(rows, rows_table)
|
||||
|
@ -14,8 +14,8 @@ event_register({"db-initialized"}, function(tr)
|
|||
print(err.Error(err))
|
||||
return
|
||||
end
|
||||
print(string.format("rows_table.id: %#v, rorws_table.username: %#v", rows_table.id, rows_table.username))
|
||||
print(string.format("rows_table.id: %#v, rows_table.dir: %#v, rows_table.title = %#v",
|
||||
rows_table.id, rows_table.dir, rows_table.title))
|
||||
end
|
||||
rows.Close(rows)
|
||||
print("Done")
|
||||
end)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue