sayfrndship
09-03-2008, 01:01 AM
I have asp code that make a query (for search) to database, in my database, the table has field which contain following information.(in 1 field).
When i search(keyword for exp : center), the query make a search to taht field and search for (center), as you see this is containing tags. When query return result. it includes all that result that contain keyword (center), no matter whether keyword is in tag or not. I need to not search keyword inside tag. and to make only search keyword(center) out side of tag. In the following case <center> should not search and official electoral campaign in center of July ... should be searched.
Tell me is it possible to do with query, or i need reg exp (ASP) that can make validation of search that search keyword is in tag or outside of tag. If reg exp can make better please provide me reg exp. The query i m using is given in last.
<center>abcdef</center>
<p> </p>
<p>The beginning of the official electoral campaign in center of July brings us one step closer to choosing Brazil’s next president. Lula’s position as the clear frontrunner was called into question last month, as Geraldo Alckmin managed to reduce Lula’s lead by 10% according to a Vox Populi poll (July 8 to 12). <br />
</p>
<table width="491" cellspacing="0" cellpadding="2" border="0">
<tbody><tr bgcolor="#dcdcdc">
<td nowrap="nowrap" colspan="3"><b>Candidacy</b></td>
</tr>
</tbody></table>
------------------------------SQL QUERY----------------------------
SELECT DISTINCT A.pageID as c1, A.Pagename as c2, A.PagesPageInserts as c4 FROM WebsitePages AS A LEFT OUTER JOIN Websitepagescontent AS AC ON A.PageID = AC.pageID WHERE A.PagePublished=1 and (A.pagename Like '%center%' OR AC.pagecontent Like '%center%' ) union SELECT DISTINCT A.ArticleID as c1, A.Title as c2, A.author1 as c4 FROM Comp_002_Articles AS A LEFT OUTER JOIN Comp_002_ArticlesPages AS AC ON A.ArticleID= AC.ArticleID WHERE A.Published = 1 and (A.Title Like '%center%' OR AC.Articlepagecontent Like '%center%' OR A.author1 Like '%center%' OR A.author2 Like '%center%' ) and A.articleCategoryID in (9,14,10,15,16,17,18,19,20,21,22)
iF YOU NEED MORE DETAIL PLEASE TELLME AND MENTION WHAT U NEED!
When i search(keyword for exp : center), the query make a search to taht field and search for (center), as you see this is containing tags. When query return result. it includes all that result that contain keyword (center), no matter whether keyword is in tag or not. I need to not search keyword inside tag. and to make only search keyword(center) out side of tag. In the following case <center> should not search and official electoral campaign in center of July ... should be searched.
Tell me is it possible to do with query, or i need reg exp (ASP) that can make validation of search that search keyword is in tag or outside of tag. If reg exp can make better please provide me reg exp. The query i m using is given in last.
<center>abcdef</center>
<p> </p>
<p>The beginning of the official electoral campaign in center of July brings us one step closer to choosing Brazil’s next president. Lula’s position as the clear frontrunner was called into question last month, as Geraldo Alckmin managed to reduce Lula’s lead by 10% according to a Vox Populi poll (July 8 to 12). <br />
</p>
<table width="491" cellspacing="0" cellpadding="2" border="0">
<tbody><tr bgcolor="#dcdcdc">
<td nowrap="nowrap" colspan="3"><b>Candidacy</b></td>
</tr>
</tbody></table>
------------------------------SQL QUERY----------------------------
SELECT DISTINCT A.pageID as c1, A.Pagename as c2, A.PagesPageInserts as c4 FROM WebsitePages AS A LEFT OUTER JOIN Websitepagescontent AS AC ON A.PageID = AC.pageID WHERE A.PagePublished=1 and (A.pagename Like '%center%' OR AC.pagecontent Like '%center%' ) union SELECT DISTINCT A.ArticleID as c1, A.Title as c2, A.author1 as c4 FROM Comp_002_Articles AS A LEFT OUTER JOIN Comp_002_ArticlesPages AS AC ON A.ArticleID= AC.ArticleID WHERE A.Published = 1 and (A.Title Like '%center%' OR AC.Articlepagecontent Like '%center%' OR A.author1 Like '%center%' OR A.author2 Like '%center%' ) and A.articleCategoryID in (9,14,10,15,16,17,18,19,20,21,22)
iF YOU NEED MORE DETAIL PLEASE TELLME AND MENTION WHAT U NEED!