Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 3rd, 2004, 06:01 AM
Authorized User
 
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default searching

Hi I have a column in my database where emails are copied to, and i need

to be able to search through each entry for certain keywords and display the

results if the column contains any of the keywords. i can't figure out how to do

this though, because if i use the select statement like this:

select * from maintable where column LIKE ('keyword')

or

select * from maintable where column IN ('keyword')

it will only display the results when the keyword is the only word in the field. Can anyone help?


 
Old September 3rd, 2004, 06:25 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Dear its mean you like the search where nothing is mathc. Think here when a user search for the key word the system should give him the result of his search nothing else. Other wise you may display the results what you want to display


(*_*)


Numan
--------------------------------------------------
Love is the most precious thing of this world. So find and grab it!
 
Old September 3rd, 2004, 06:33 AM
Authorized User
 
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i'm sorry i don't understand what you mean? can you explain again? thanks again!

 
Old September 3rd, 2004, 07:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

You need to add wildcard char to your keyword (* for Access or % for SQL Server):
select * from maintable where column LIKE ('%keyword%')

If you have more than one keyword you need to use OR:
select * from maintable where column LIKE ('%keyword1%') OR column LIKE ('%keyword2%')





Similar Threads
Thread Thread Starter Forum Replies Last Post
searching a database mark jonas MySQL 13 January 19th, 2007 10:01 AM
Federated searching _abhi JSP Basics 0 December 27th, 2006 02:24 AM
Searching through a database d5t ASP.NET 1.0 and 1.1 Basics 6 October 27th, 2006 07:10 AM
Slow Searching zaheer131 VB How-To 0 March 15th, 2005 03:26 AM
Searching programmed C++ Programming 1 June 24th, 2004 01:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.