Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - search formating
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

search formating

 Post Reply Post Reply
Author
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Topic: search formating
    Posted: 17 April 2005 at 8:00pm
i made a simple search engine to search for text inside database field.
it works fine but my problem is when the text is formated in the field it doesn't bring it.
 
is there a way?
Back to Top
bootcom View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 February 2005
Location: United Kingdom
Status: Offline
Points: 259
Post Options Post Options   Thanks (0) Thanks(0)   Quote bootcom Quote  Post ReplyReply Direct Link To This Post Posted: 17 April 2005 at 9:24pm
Not too sure what you mean there zMaestro, but I interpret that as its not finding the full word as it's wrapped in tags Confused, correct me if Im wrong there lol.
 
Just create the SQL to do a LIKE (like this)
 

"SELECT * FROM aTable WHERE field LIKE '%" & request("search_text") & "%'"
Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 18 April 2005 at 4:07am
if the field contents is: "My name is <b>zMaestro</b>"
the result which will appear is: My name is zMaestro
 
is i searched with the string "is zMaestro" there will be no result found.
if i worte in the string "is <b>zMaestro</b>" there will be results.
 
i got an idea from the code here, and i think that is the way, i take the message to a temp variable, and replace all the tag, and store the output, then search it, am i right?
Back to Top
bootcom View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 February 2005
Location: United Kingdom
Status: Offline
Points: 259
Post Options Post Options   Thanks (0) Thanks(0)   Quote bootcom Quote  Post ReplyReply Direct Link To This Post Posted: 18 April 2005 at 4:15am
Post the code on here you are using matey, your being a little vague.
 
If your doing a standard search though, using the code I gave above should do the trick you could write "Mae" and it would find all records that have that in record entry of the field you are trying to search.
 
But let's take a look at the code you're trying ot use and I will hopefully be able to  help you out.
Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 18 April 2005 at 8:48am

<table>
<%
set RSpecial= server.createobject ("ADODB.recordset")

QLSpecial = "SELECT * FROM aTable WHERE filedname LIKE '%"&Request("text")&"%' ORDER BY ID;"

RSpecial.open QLSpecial, Conn, 1, 3

While Not RSpecial.EOF

Response.Write "<tr><td>"&RSpecial("filedname")&"</td></tr>"

RSpecial.MoveNext : Wend

%></table>


Edited by zMaestro - 18 April 2005 at 8:50am
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.