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.

Some Help Whit Mysql stuff :D

Old posts that have not been replied to for several years.
Locked
b
benzon
Voice
Posts: 11
Joined: Sun Apr 11, 2004 8:24 am

Some Help Whit Mysql stuff :D

Post by benzon »

http://forum.egghelp.org/viewtopic.php?t=7112 <-- Yoused a part of that ex sombody gave a bit down the site.

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 :)
b
benzon
Voice
Posts: 11
Joined: Sun Apr 11, 2004 8:24 am

Post by benzon »

error reading package index file /usr/local/lib/tcl8.3/Memchan/pkgIndex.tcl: expected version number but got "."

This is the error i get :|
b
benzon
Voice
Posts: 11
Joined: Sun Apr 11, 2004 8:24 am

Post by benzon »

uhm okay i can add to mysql now hehe just need the replacement feature :\
b
benzon
Voice
Posts: 11
Joined: Sun Apr 11, 2004 8:24 am

Post by benzon »

fixed regsub were my frind :D
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

what is the exact problem ?
XplaiN but think of me as stupid
b
benzon
Voice
Posts: 11
Joined: Sun Apr 11, 2004 8:24 am

Post by benzon »

got it fixed, by yousing som time to search this forum and looking on all script i cut find whit mysql :) so no problem more :D
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

k...
XplaiN but think of me as stupid
b
benzon
Voice
Posts: 11
Joined: Sun Apr 11, 2004 8:24 am

Post by benzon »

and thx for a nice site :)
Locked