#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    4
    Rep Power
    0
    Im using a Mysql server and Perl to access it, to search for a complete string is cake, but i wanna search for like an 'a' and that it gives back 'bakes', 'blaa'. How can i get Perl to use wildcards to search?

    my $SQL = "select * from Document where ($cgi_data{'Zoekoptie'} = '$cgi_data{'zoek'}')";

    where 'Zoekoptie' is the search parameter and 'zoek' is table you wanna search.

    PLease give me some advice so i can search.

    Tnx in advance.

    BuTcH!
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Hi you can use wildcard to serch.

    You may use wildcard `%' or `_' for searching


    eg;

    To find names beginning with `a':

    mysql> SELECT * FROM tblname WHERE name LIKE "a%";

    To find names ending with `a':

    mysql> SELECT * FROM tblname WHERE name LIKE "%a";


IMN logo majestic logo threadwatch logo seochat tools logo