proc pub_query { nick host ident chan arg } {
putlog "in #chan $nick used !query $arg"                                     
foreach info [sql "SELECT * FROM table WHERE name like '\\\%[lindex $arg 0]\\\%' ORDER BY date DESC"] {
#possible forloop in here?#
}
putquick "PRIVMSG #twizchan :(sqlbot) found [sql numrows] matches to $arg"
}

############
# in dcc chat with bot this is outputted:
############
# debug: 1085993751 tWiZtEr.Sucks.At.SQL NOTE