| View previous topic :: View next topic |
| Author |
Message |
S0nnY Voice
Joined: 07 Sep 2004 Posts: 8 Location: Germany
|
Posted: Mon Dec 19, 2005 12:43 am Post subject: Problem with mysql and wildcards |
|
|
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 |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Dec 19, 2005 2:29 am Post subject: |
|
|
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 |
|
 |
S0nnY Voice
Joined: 07 Sep 2004 Posts: 8 Location: Germany
|
Posted: Mon Dec 19, 2005 3:05 am Post subject: |
|
|
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 |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Dec 19, 2005 3:58 am Post subject: |
|
|
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 |
|
 |
S0nnY Voice
Joined: 07 Sep 2004 Posts: 8 Location: Germany
|
Posted: Mon Dec 19, 2005 5:07 am Post subject: |
|
|
| 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 |
|
 |
greenbear Owner
Joined: 24 Sep 2001 Posts: 733 Location: Norway
|
Posted: Mon Dec 19, 2005 12:50 pm Post subject: |
|
|
| mysql use % as wildcard, not * |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Tue Dec 20, 2005 12:02 am Post subject: |
|
|
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 |
|
 |
|