Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Help with Search Query
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Astralis
Senior Member

USA
1218 Posts

Posted - 13 March 2005 :  16:20:07  Show Profile  Send Astralis a Yahoo! Message
What is wrong with this search query? It's bringing up every record in the database:


		entriesSQL="select BLOG_ENTRIES.*, BLOG_CATEGORIES.* from BLOG_ENTRIES" _
			& " inner join BLOG_CATEGORIES on BLOG_ENTRIES.CATEGORY_ID = BLOG_CATEGORIES.CATEGORY_ID" _
			& " where (ENTRY_TEXT like '%" & searchwords & "%' " _
			& " or ENTRY_TITLE like '%" & searchwords & "%'" _
			& " and BLOG_ENTRIES.B_AUTH_ID = " & author _
			& " and ENTRY_IS_DRAFT=0)" _
			& " order by ENTRY_DATE desc, ENTRY_TIME desc;"

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 14 March 2005 :  04:31:26  Show Profile  Visit Gremlin's Homepage
Response.Write it out so you can actually see what variables are being populated, I find it's always easier to debug this way rather than staring at the code for hours looking for a problem when it may in fact be related to the variables your passing the query and not the query itself.

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 14 March 2005 :  07:17:22  Show Profile
Shouldn't you precede each field name in your where clause with BLOG_ENTRIES?


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07