December 1st, 2003, 03:45 AM
I have built a directory that allows users to search via business names.
The data is stored in MS Sql database.
The website has been been developed using asp scripting.
My problem comes down to this.
If a user searches for joe smith refridgeration they can do so by entering joe, smith, joe smith, refridgeration, joe smith refridgeration, smith refridgeration
but i need to make it work if some enters refridgeration joe smith, joe refridgeration etc.
Is this possibe?
Does anyone know how to do it?
Thanks in advance.
December 2nd, 2003, 04:45 PM
Have you ASP code generate a query that has a LIKE statement for every search term like the example below.
SELECT * FROM datatable
WHERE textdata LIKE '%refridgeration%'
AND textdata LIKE '%joe%'
AND textdata LIKE %'smith%'
December 2nd, 2003, 05:06 PM
Currently the user is inserting all that data into the one field.
So how would I go about splitting the field down into seperate query string elements?
December 3rd, 2003, 01:32 PM
Not sure how to do it in ASP, but it can't be that difficult. I think you wout use the cut function.
December 3rd, 2003, 06:29 PM
i use frontpage to modify asp pages and i have a database results proporties options and it lets me split a text field up separated by commas or whatever and you can do your query with like or contains based on a specific field.
December 4th, 2003, 05:33 AM