bind pub - !insert insert:pub
proc insert:pub {nick uhost hand chan arg} {
# inserting mysql array
global mysql
# Set data variables.
set title [lindex $arg 0]
set data [join [lrange $arg 1 end]]
# Check if there is data pressent to insert.
if {![string match {} [lindex $arg 1]]} {
# Selecting a valid db.
mysqluse $mysql(conn) $mysql(data)
# Inserting data to the db
mysqlexec $mysql(conn) "INSERT INTO test (test_title,test_data) VALUES ('$title','$data');"
# If a proc is broken when an error occours like inserting data into a
# db, then this could be a verification of a succesfull query
putserv "PRIVMSG $chan :Query ended."
} else {
putserv "PRIVMSG $chan :Syntax error."
}
}
Is it posible to divide it up 2 the eg
Clan Name som clan got space it so eg Clan_name and before it add it it remove the _ and add a space insted is that posible and how?
Secound Clan Chan eg #somechan and http://somehp.com
I think i know how that works i will do a ex ad it hehe
bind pub - !insert insert:pub
proc insert:pub {nick uhost hand chan arg} {
# inserting mysql array
global mysql
# Set data variables.
set clanname [lindex $arg 0]
set channame [lindex $arg 1]
set clanhttp [lindex $arg 3]
# Check if there is data pressent to insert.
if {![string match {} [lindex $arg 1]]} {
# Selecting a valid db.
mysqluse $mysql(conn) $mysql(data)
# Inserting data to the db
mysqlexec $mysql(conn) "INSERT INTO test (clan_name,clan_chan,clan_hp) VALUES ('$clanname','$channame','$clanhttp');"
# If a proc is broken when an error occours like inserting data into a
# db, then this could be a verification of a succesfull query
putserv "PRIVMSG $chan :Query ended."
} else {
putserv "PRIVMSG $chan :Syntax error."
}
}
Is that the right way that i did that ? :\
But if so and it´s right i realy need you to help me how to do that so i can put in like Some_clan_blah and it remove the _ and add a space insted hope sombody will help me
