Communauté Eggdrop
problem de proc - Version imprimable

+- Communauté Eggdrop (https://forum.eggdrop.fr)
+-- Forum : Eggdrop et TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=8)
+--- Forum : Scripts TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=4)
+--- Sujet : problem de proc (/showthread.php?tid=781)



problem de proc - yannick22 - 06/11/2010

Bonjour jaimerais savoir ajouter un arg dans un proc

je veux sa comme sa


proc pr:addtest { nick uhost handle channel arg1 arg2 } {
global pdb
set table "$pdb(table)"
set sqlhand [mysqlconnect -host $pdb(hostname) -user $pdb(username) -password $pdb(password)]
mysqluse $sqlhand $pdb(database)
mysqlexec $sqlhand "INSERT INTO $table ( id , test1 , test2 , date ) VALUES ('', '$arg1', '$arg2', NOW( ))"
mysqlclose $sqlhand
putserv "PRIVMSG $channel Razzrayer request has been added"
putcmdlog "<<$nick>> !$handle! Added a prayer request in $channel."
}


aussitot que je mais arg2 sa me donne une erreur


RE: problem de proc - BeussAy - 06/11/2010

Bonjour.

La procédure est appelée par un bind? Si oui! Lequel?

Je t'invites à jeter un coup d'oeil ici > MySQLTCL < et ici > Procédures <
Il est tard ou tôt mais moi je vais me coucher!

Bonne nuit


RE: problem de proc - yannick22 - 06/11/2010

regarde ma te montrer ma config complete



load libmysqltcl.dll
package require mysqltcl


set pdb(hostname) "localhost"
set pdb(username) "username"
set pdb(password) "password"
set pdb(database) "site"
set pdb(table) "pre"



bind pub - !addpre pr:addpre
bind pub - !pre pr:pre




# Adding
proc pr:addpre { nick uhost handle channel arg1 arg2 } {
global pdb
set table "$pdb(table)"
set sqlhand [mysqlconnect -host $pdb(hostname) -user $pdb(username) -password $pdb(password)]
mysqluse $sqlhand $pdb(database)
mysqlexec $sqlhand "INSERT INTO $table ( id , section , rls , date ) VALUES ('', '$arg1', '$arg2', NOW( ))"
mysqlclose $sqlhand
putserv "PRIVMSG $channel Razzrayer request has been added"
putcmdlog "<<$nick>> !$handle! Added a prayer request in $channel."
}


je voudraix que sa marche comme sa