egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with mysql and wildcards

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
S0nnY
Voice


Joined: 07 Sep 2004
Posts: 8
Location: Germany

PostPosted: Mon Dec 19, 2005 12:43 am    Post subject: Problem with mysql and wildcards Reply with quote

Hello,

I have a small problem. I want to create an "global ignore function" for a game script.
All my code works fine but i want to add hosts in the database containing a wildcard "*!*@Test*.org" for example.
But when the bots connects to the database an gets the informations the check the user host the * isn't a wildcard anymore also "test!test@Test.users.quakenet.org" is not matched.

How can I convert the sign * back to a wildcard ?

greetz
S0nnY
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Mon Dec 19, 2005 2:29 am    Post subject: Reply with quote

post code & log
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
S0nnY
Voice


Joined: 07 Sep 2004
Posts: 8
Location: Germany

PostPosted: Mon Dec 19, 2005 3:05 am    Post subject: Reply with quote

Ok here is a split of the ignore check code

$host ==> examp@example.users.quakenet.org
Code:
 
  set ign(hosts) "[hosts:get]" <== returns all added hosts in the database ("examp@*.org"  "*@test.users.quakenet.org" for example)
  foreach h0st $ign(hosts) {
    if {[string match -nocase "$h0st" $host]} {
      return 1
    } else {
      return 0
    }
  }


proc hosts:get { } {
  global ign
  set sqlhand [mysqlconnect -host $ign(ip) -user $ign(user) -password $ign(pass)]
  mysqluse $sqlhand $ign(tab)
  set return "[mysqlsel $sqlhand "SELECT host FROM $ign(ignoredb)" -list]"
  mysqlclose $sqlhand
  return $return
}



the * is not recognized as wildcard
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Mon Dec 19, 2005 3:58 am    Post subject: Reply with quote

so what's the problem, you don't get *'s back from db? what did you put there and what did you get back using [hosts:get]?
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
S0nnY
Voice


Joined: 07 Sep 2004
Posts: 8
Location: Germany

PostPosted: Mon Dec 19, 2005 5:07 am    Post subject: Reply with quote

Quote:
"[hosts:get]" <== returns all added hosts in the database ("examp@*.org" "*@test.users.quakenet.org"


a * which is returned from the mysqdatabase is "marked" as "normal" sign and not as wildcard. this is my problem
Back to top
View user's profile Send private message
greenbear
Owner


Joined: 24 Sep 2001
Posts: 733
Location: Norway

PostPosted: Mon Dec 19, 2005 12:50 pm    Post subject: Reply with quote

mysql use % as wildcard, not *
Back to top
View user's profile Send private message Send e-mail
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Dec 20, 2005 12:02 am    Post subject: Reply with quote

what do you care about mySQL's interpretation of *? you don't have WHERE clause anyway

if *'s come back to you as you saved them, I fail to see the problem here
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber