Code: Select all
set my(host) "..."
set my(user) "...
set my(pass) "..."
set my(db) "..."
proc mysql:do {nick} {
global my
set handle [::mysql::connect -host $my(host) -user $my(user) -password $my(pass) -db $my(db)]
set check "SELECT player FROM filelist WHERE player = '[::mysql::escape $nick]'"
if {[set channel [::mysql::sel $handle $check -list]]!=""} {set do -update} {set do -insert}; putlog "$channel $do"
switch -exact -- $do {
-insert {
set query "INSERT INTO `filelist` (id, laston, player, hostname, daily, weekly, monthly, total, cps, fast, qa, qar, rounds, rpoints, teamp, teamr, teamn) VALUES ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17',NOW())"
set result [::mysql::exec $handle $query]
if {$result != "1"} {putlog "an error has ocurred with sql: * $result"} {putlog "executing: $query - \00304Ok."}
}
-update { set query "UPDATE `web_statistics` SET `manager`='[::mysql::escape $my(manager)]', `valid`='$my(valid)', `time`=NOW() WHERE channel='$channel'"
set result [::mysql::exec $handle $query]
if {$result != "1"} {putlog "an error has ocurred with sql: * $result"} {putlog "executing: $query - \00304Ok."}
}
::mysql::close $handle
}
}
Tcl error: ::mysql::exec/db server: Column count doesn't match value count at row 1