navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

DRW results from specific words in a column

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> DRW results from specific words in a column
Page: [1]
 
mjmtravel

 

Posts: 257
Joined: 7/30/2006
Status: offline

 
DRW results from specific words in a column - 8/21/2008 20:32:28   
I have a drw results page that I need to pull the entire row of information from one word in a specific column. I have the results working but I'm getting all of the rows in my column name IslandName instead of the word I'm searching.

Here is what I'm using.
1st page
fp_sQry="SELECT * FROM Results WHERE (IslandName LIKE '%::Grenada::%')"
2nd page
fp_sQry="SELECT * FROM Results WHERE (IslandName LIKE '%::BVI::%')"

I'm carrying the link from a word on another page with to the new grenada.asp & bvi.asp page with this code
<%=FP_FieldVal(fp_rs,"IslandName")%>

Is this the correct way to do the search or am I missing something?

Thanks again for your help in advance.
pd_it_guy

 

Posts: 191
Joined: 3/4/2008
Status: offline

 
RE: DRW results from specific words in a column - 8/22/2008 10:17:41   
Is Grenada a variable name, or is it actually what you are looking for. Is it a pick that is sent over to the drw.

in which case,

...WHERE (IslandName LIKE %'Grenada'%)" should get us all the granada's even if buried in text.

If granada is actually a variable?? then did you try it like this

...WHERE (IslandName LIKE %'::Grenada::'%)"

Good luck...



< Message edited by pd_it_guy -- 8/22/2008 10:26:21 >

(in reply to mjmtravel)
William Lee

 

Posts: 1176
Joined: 1/25/2002
From: Singapore
Status: offline

 
RE: DRW results from specific words in a column - 8/22/2008 10:23:03   
Are Grenada and BVI names of the textbox control?

You may be getting ALL the records because you actually don't have textboxes with these names. So, when you submit the search, the value of Grenada and BVI in the fp_sQry is empty string and this typically will return ALL records.

HTH

_____________________________

William Lee

pǝssǝɟoɹd-ɟ1ǝs ʎɥʇɹoʍʇsnɹʇ ʇsoɯ ɹnoʎ
nɹnb ǝsɐqɐʇɐp & dsɐ ,ʍɹp ,ǝbɐdʇuoɹɟ





(in reply to mjmtravel)
mjmtravel

 

Posts: 257
Joined: 7/30/2006
Status: offline

 
RE: DRW results from specific words in a column - 8/22/2008 18:44:22   
Thanks for the reply,

I should have been a little clearer. The page one and page two are both results pages for each island.
Grenada and BVI are names I want to search in a column named IslandName, to show results of all entries in each row with that particular name. I don't want to search the entire table for each word.


I'm using IslandName in the hyperlink from another page.
href="http://www.islandtime.com/grenada.asp?IslandName=<%=FP_FieldVal(fp_rs,"IslandName")%>">

I hope that makes sense.
I did try the above variable but got a database results error, also I have the column name in my results page so I should get the individual results.

(in reply to William Lee)
pd_it_guy

 

Posts: 191
Joined: 3/4/2008
Status: offline

 
RE: DRW results from specific words in a column - 8/22/2008 19:05:48   
Ok much clearer now, thanks.

IslandName is the column for the DB. Grenada, along with all the other island locations may appear with stuff either before or after it. All records where "Grenada appears in the IslandName field is the goal.

We know the basic query is OK because temporarily removing WHERE restrictions gets everything

WHERE (IslandName LIKE '%::Grenada::%' gets no records at all because grenada was never a variable and was never bracketed by %'s

Do we understand that ...WHERE (IslandName LIKE %'Grenada'%)... gets you a db error?

What does ...WHERE (IslandName LIKE '% Grenada %').. do. But I dont think the string delimiter ' should encapsulate the % operator

See if it might need a space, thus: ...WHERE (IslandName LIKE % 'Grenada' %)...


(in reply to mjmtravel)
mjmtravel

 

Posts: 257
Joined: 7/30/2006
Status: offline

 
RE: DRW results from specific words in a column - 8/22/2008 19:18:40   
WHERE (IslandName LIKE '% Grenada %')" This one gets me no results found
WHERE (IslandName LIKE % 'Grenada' %)" This one gets me the database results error.
Its close but not yet.

(in reply to pd_it_guy)
William Lee

 

Posts: 1176
Joined: 1/25/2002
From: Singapore
Status: offline

 
RE: DRW results from specific words in a column - 8/22/2008 19:22:32   
Your variable passed to the next page is IslandName, so try this:

fp_sQry="SELECT * FROM Results WHERE (IslandName LIKE '%::IslandName::%')"




_____________________________

William Lee

pǝssǝɟoɹd-ɟ1ǝs ʎɥʇɹoʍʇsnɹʇ ʇsoɯ ɹnoʎ
nɹnb ǝsɐqɐʇɐp & dsɐ ,ʍɹp ,ǝbɐdʇuoɹɟ





(in reply to mjmtravel)
pd_it_guy

 

Posts: 191
Joined: 3/4/2008
Status: offline

 
RE: DRW results from specific words in a column - 8/22/2008 19:28:10   
Rgr that. Alternatively the fixed- query syntax appears to be:

WHERE (IslandName LIKE '%Grenada%')

It was the one option we did not yet try I believe.

(in reply to William Lee)
mjmtravel

 

Posts: 257
Joined: 7/30/2006
Status: offline

 
RE: DRW results from specific words in a column - 8/22/2008 19:35:57   
Bingo, that last one worked, thanks a bunch guys. Now I can continue to build until I run into more snags.

Thanks again. Have a good night.

(in reply to pd_it_guy)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> DRW results from specific words in a column
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts