This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Problems with Invite MySQL script

Old posts that have not been replied to for several years.
a
almighty
Voice
Posts: 30
Joined: Tue Jan 07, 2003 5:34 pm
Contact:

Post by almighty »

right new thing.

Code: Select all

bind msg - login inv_1

load /home/almighty/eggdrop/scripts/sql/fbsql.so
proc inv_1 { nick uhost hand arg } {
        global chan_1
        set arg [split $arg]
        set user [lindex $arg 0]
        set pass [lindex $arg 1]
        sql startquery "SELECT * FROM tbl_member WHERE username = '$user' AND password = '$pass'"
        sql endquery
        sql startquery
        if {[sql numrows] == 0} {
        sql endquery
        putserv "PRIVMSG $nick :Invalid password or username!"
        putserv "PRIVMSG #ae-hc :\0034Invalid Login:\003 $nick (Username: $user)"
        putcmdlog "$nick has failed to log in using $user as a username"
        } else {
        sql endquery
        putserv "PRIVMSG #ae-hc :\0039Successful Login:\003 $nick (Username: $user)"
        putquick "invite $nick $chan_1"
        putcmdlog "$nick has successfully logged in using $user as a username"
        sql disconnect
        }
}
right the error message im getting in the log files is:

Code: Select all

[23:01] Tcl error [inv_1]: Another query cannot be made until the current query has been finished with "sql endquery".
i no i need to use sql endquery except im not sure where to put them, as does a query count as mysql or tcl commands?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

A query is a a SQL statment.

After you have finished with teh data a query returns, you need to tell the Tcl library as such.

Usualy ending the query at all the exit points of a proc (IE, any place before a return, or where the script stops)_
a
almighty
Voice
Posts: 30
Joined: Tue Jan 07, 2003 5:34 pm
Contact:

Post by almighty »

ok all sorted now thanks
Locked