Welcome to WebmasterWorld Guest from 3.81.29.226

Forum Moderators: ocean10000

Message Too Old, No Replies

ASP Classic Database looping

     
6:01 pm on Sep 21, 2008 (gmt 0)

New User

10+ Year Member

joined:Aug 18, 2005
posts: 37
votes: 0


I'm trying to display information from a database on a webpage using asp classic. The issue is, I have a field that has various data in it, I need to search through the data in that field to find a specific number and then display it on the site. Also the number may be repeated so I need it to display all results from the query.

So in other words I have table_tbl with fld_1 fld_2 and fld_3. fld_3 will have numbers in it for example 1, 2, 3, 2 in different record sets. I need to beable to search for (example) "2" and desplay all resulting recordsets. Any clues?

5:11 am on Sept 22, 2008 (gmt 0)

Administrator

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
posts:864
votes: 3


Example of the sql query. You will need to replace the search value, but should give you an idea how to search.

select fld_1, fld_2, fld_3
from table_tbl
where fld_3 like '%2%';

I am going to assume fld_3 is a text/string datatype for the search.

5:18 pm on Sept 22, 2008 (gmt 0)

New User

10+ Year Member

joined:Aug 18, 2005
posts: 37
votes: 0


Thank you I have that part set up and it's pulling those fields, but, the problem is now there are four record sets, two have the value of "2". It loops through the selected record sets but displays both of them 4 times (I'm assuming because there are 4 record sets) is there any way to limit this?
2:03 am on Sept 28, 2008 (gmt 0)

Junior Member

10+ Year Member

joined:June 21, 2005
posts: 60
votes: 0


Can you combine the recordsets or are you pulling from 4 different databases?

Casey