469,333 Members | 4,558 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,333 developers. It's quick & easy.

.asp

hey guys

I am working on thr professors website. In the website, when you fill in the author's name it retrieves information.

So if the authors name is J. smith, then if I write Smith, J. then it gets the information since it stored in the database in this format. But if I type in J. Smith it does not get any information.

I need to write this code in the .asp file where the scripting language in VBScript. So if anyone of you can help me out with this, i would reall appreciate it. Any form of help is appreciated.

Thanks guys

Kapil
Apr 3 '07 #1
2 976
jhardman
3,406 Expert 2GB
You could handle it in the query statement:
Expand|Select|Wrap|Line Numbers
  1. names = split(nameEntered, " ")
  2. query = "SELECT * FROM authors WHERE authorName = '" & names(0) &_
  3.      ", " & names(1) & "' OR authorName = '" & names(1) & ", " & names(0)_
  4.     & "'"
  5. response.write "<!-- query: " & query & " -->" & vbNewLine
  6.  
let me know if this helps. Or you could use instr to see if the user used a comma.

Jared
Apr 3 '07 #2
You could handle it in the query statement:
Expand|Select|Wrap|Line Numbers
  1. names = split(nameEntered, " ")
  2. query = "SELECT * FROM authors WHERE authorName = '" & names(0) &_
  3.      ", " & names(1) & "' OR authorName = '" & names(1) & ", " & names(0)_
  4.     & "'"
  5. response.write "<!-- query: " & query & " -->" & vbNewLine
  6.  
let me know if this helps. Or you could use instr to see if the user used a comma.

Jared
Hey it did work Thanks a lot.
Apr 3 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by William C. White | last post: by
2 posts views Thread by Albert Ahtenberg | last post: by
3 posts views Thread by James | last post: by
reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
4 posts views Thread by Albert Ahtenberg | last post: by
1 post views Thread by inderjit S Gabrie | last post: by
2 posts views Thread by Jack | last post: by
3 posts views Thread by Sandwick | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.