proc finduser {nick host hand channel arg} {
global mysql
set search [string map {" " "%"} [lindex $arg]]
set query [mysqlsel $mysql(conn) "SELECT * FROM `users` WHERE `name` LIKE '$search' ORDER BY id DESC LIMIT 3" -list]
if {$query==""} { putquick "PRIVMSG $channel :$arg not found." ; return }
foreach result $query {
set id [lindex $result 0]
set name [lindex $result 1]
set city [lindex $result 2]
set newcity [lindex $result 3]
putquick "PRIVMSG $channel :Info ($id) $name is from $city"
}
}
This output to chan "Info ($id) $name is from $city" is usually okey when $newcity is blank
in mysql db, but if there's some text in newcity field in db, I'd like to change output to "Info ($id) $name is from $city but has moved to $newcity".
So how do I do that..?
However, a second question qbout MySQL..
My db is MyISAM as described above.. However, when I'm adding data to it (checking if $name allready exists before adding) it's slow and 'hanging' the computer for 1-2 seconds.. I'm no sql guru, but what might I be doing wrong..?