Database Query 
Author Message
 Database Query

Hi,

I have just set up a database for storing my personnel contacts. I'm
using Mysql version 3.22.32 , Perl version 5.005_03 on a Linux / Unix
server. I'm using one table with columns such as first name, last name,
phone ETC.. and another column called interests. This stores keywords such
as sport, folk music, gardening, opera ETC.
I'm accessing the Mysql DB through a web browser. I have made a script using
Perl, which will happily search any column and return the results.

The  problems begin when I enter more than one word in the search box. How
do I separate each word (if there was more than one) and then parse that to
the DB. BTW it's inevitable I'll want to do an advanced search in the near
future. Can anyone help me with some ideas regarding the Boolean search
thing?

Thanks in advance.

Paul




Thu, 19 Sep 2002 04:00:00 GMT  
 Database Query
On Sun, 2 Apr 2000 22:01:16 +0100, "Paul Whippey"

Quote:

>Hi,

>I have just set up a database for storing my personnel contacts. I'm
>using Mysql version 3.22.32 , Perl version 5.005_03 on a Linux / Unix
>server. I'm using one table with columns such as first name, last name,
>phone ETC.. and another column called interests. This stores keywords such
>as sport, folk music, gardening, opera ETC.
>I'm accessing the Mysql DB through a web browser. I have made a script using
>Perl, which will happily search any column and return the results.

>The  problems begin when I enter more than one word in the search box. How
>do I separate each word (if there was more than one) and then parse that to
>the DB. BTW it's inevitable I'll want to do an advanced search in the near
>future. Can anyone help me with some ideas regarding the Boolean search
>thing?

>Thanks in advance.

>Paul



In my rather poor search engine
( http://www.megaroms.co.uk/search.html )
I take the search string, $SearchString, and then split it into an
array of individual words using

I then can loop round using these words as I wish. This obviously uses
spaces to distinguish between words.

I'm not familiar with Mysql (BTW where can I dowload it?) but I would
have thought something like:



$SQLString=$SQLString.$WhereString;

and then use SQLString for the query. If You want to search multiple
fields just do multiple 'map's with the result being concatenated on
the end of the where statement in the SQL.

For the Boolean search I would have thought writing your own version
of 'join' which would look at the start of the word for a '+' and join
with an 'and' or use an 'or' by default. Something like that??

Hope that makes sense.

-------------
Timothy Smith



Sat, 21 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Database querying

2. Database Query

3. Help with multiple database queries using Perl and Mysql.pm

4. www-database queries

5. Database queries from a web browser Questions....

6. Database querying report tool?

7. Perl script: given database query, show html result table

8. URGENT! Perlscript + Asp - multiple database queries??

9. Web Database Access with sub-queries.

10. CGI Database prog weird query results

11. Flatfile Database Search - Displaying Results Query

12. how to query oracle database and send output to screen

 

 
Powered by phpBB® Forum Software