Forums

This topic is locked

Problem with the LIKE clause

Posted 15 Aug 2002 01:54:03
1
has voted
15 Aug 2002 01:54:03 Stephen Butler posted:
Hello,

My problem is that I have a database of songs that I have written with my band. I'm new to this SQL game so am simply creating a means of searching by title at the moment. All fine and dandy so far, except that every time I enter a song title in my search field, it always brings up the first title in the database. My SQL is very simple, thus:

SELECT *
FROM tblSongs
WHERE Title LIKE '%MMColParam%'
ORDER BY Year ASC

The Variable has a name of MMColParam, a Default Value of 1 and a Run Time Value of Request.QueryString ("Title"

And yet, whenever I test it in Dreamwever using the Recordset Test function, it works fine, but when I test it in a Browser, it doesn't, because it always brings up the first title in the database list. I notice in the browser window in the bottom left it says that the results page is searching for the first title in the list, even though I don't want it to. Any ideas?

Thanks

Stephen Butler

Replies

Replied 15 Aug 2002 16:33:59
15 Aug 2002 16:33:59 Vince Baker replied:
I would check that you are sending the correct field in the URL.....

Not sure how much you know (sorry if this is too basic) but the url should be like:

yoursite/page.asp?Index=*****

CHeck that the ?Index= is correct and that it is actually sending something to the results page.

Reply to this topic