Table layout: id, commando, aantal (where aantal is the field which I want to update)
Table has 1 (test) row: id=1, commando=!test, aantal=0
Code: Select all
proc user {nick host hand chan text} {
package require sql
set conn [sql connect $host $user $pwd]
set res [catch {sql selectdb $conn $db} msg]
set output [sql query $conn "SELECT MAX(aantal) FROM nROServ WHERE commando LIKE '!test'"]
set row [sql fetchrow $conn $output]
set aantal $row
putlog "$aantal"
incr $aantal
set omhoog [sql exec $conn "UPDATE nROServ SET aantal = '$aantal' WHERE commando LIKE '!test'"]
sql disconnect $conn
}
Tcl error [user]: can't read "0": no such variable
The error might be the incr $aantal but I don't know for sure.
Could someone advice me what to do?
thx
Chrizz