Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Perl and MySQL - performing a search...

by CountZero (Bishop)
on Jan 26, 2003 at 22:38 UTC ( #230063=note: print w/replies, xml ) Need Help??


in reply to Perl and MySQL - performing a search...

Provided you have a good collection of bad usernames, this should do the trick:

$sth = $dbh->prepare ("SELECT count(*) FROM forbidden_usernames WHERE +f_user LIKE ?"); $sth->execute($str); ($bad) = $sth->fetchrow_array; print "Bad username\n" if $bad;

Warning: untested code! It's too late to cobble a mySQL database together to test it and my "Programming the Perl DBI" is upstairs.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://230063]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2020-08-13 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (73 votes). Check out past polls.

    Notices?