proc pub_query { nick host ident chan arg } {
	# $arg is [split] in order to turn it into a valid tcl list which can then be safely [lindex]'ed
	set arg [lindex [split $arg] 0] ;# We don't need the rest of it, do we?
	set results [sql "SELECT * FROM table WHERE name like '\\\%${arg}\\\%' ORDER BY date DESC"]
	set resultCount [llength $results]
	
	putserv "PRIVMSG #twizchan :(sqlbot) found $resultCount matches to $arg (diaplaying max of 10)"
	
	for {set i 0} {$i < 10} {incr i} {
		putserv "PRIVMSG #twizchan :(sqlbot) #[expr $i + 1]: [lindex $results $i]"
		# example channel output (excluding row count):
		# 1085993751 tWiZtEr.Sucks.At.SQL NOTE
	}
}