| Author |
Topic Search Topic Options
|
ub3rl337ch3ch
Senior Member
Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
|
Post Options
Thanks(0)
Quote Reply
Topic: Multiple SQL "where" clauses Posted: 18 February 2005 at 12:29am |
I know that when using sql you can go WHERE blahblahblah AND blahblahblah, and that you can have a where that is dependent on user input, but is it possible to have a query that has multiple user dependent WHERE clauses? Help appreciated
|
 |
Phat
Senior Member
Joined: 23 February 2003
Status: Offline
Points: 386
|
Post Options
Thanks(0)
Quote Reply
Posted: 18 February 2005 at 5:34am |
|
Won't somthing like below give you what you want?
SELECT tblAuthor.Username, tblAuthor.User_code, tblAuthor.Password,
tblAuthor.Author_email, tblAuthor.Show_email, tblAuthor.Homepage
FROM tblAuthor
WHERE (((tblAuthor.Username)="ddff") AND ((tblAuthor.User_code)="dfdf") AND ((tblAuthor.Password)="dfdf"));
How do want multiple where caluses?
|
 |
michael
Senior Member
Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
|
Post Options
Thanks(0)
Quote Reply
Posted: 18 February 2005 at 10:20am |
|
You can only have ONE where clause in SQL
|
|
|
 |
ub3rl337ch3ch
Senior Member
Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 February 2005 at 5:21pm |
I need it to be something like
"SELECT * from x WHERE 1.x=" request.form(1) AND 2.x = request.form(2)
That doesn't work becuase it thinks that i'm looking for 1.x equalling "request.form(1) and 2.x = reuqest.form(2)"
Edited by ub3rl337ch3ch - 20 February 2005 at 5:21pm
|
 |
ub3rl337ch3ch
Senior Member
Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 February 2005 at 5:28pm |
|
Phat, thanks, the brackets thing seems to be working.
|
 |
ub3rl337ch3ch
Senior Member
Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 February 2005 at 11:08pm |
|
gah, I just went back to it and the bloody bracket thing just stopped working... if anyone has any suggestions, i might just be convinced not to throw the computer in front of a truck...
|
 |
Phat
Senior Member
Joined: 23 February 2003
Status: Offline
Points: 386
|
Post Options
Thanks(0)
Quote Reply
Posted: 21 February 2005 at 2:56am |
|
you may want to use or instead of and
|
 |
dj1811
Newbie
Joined: 11 February 2005
Status: Offline
Points: 26
|
Post Options
Thanks(0)
Quote Reply
Posted: 21 February 2005 at 6:18pm |
ub3rl337ch3ch wrote:
I need it to be something like
"SELECT * from x WHERE 1.x=" request.form(1) AND 2.x = request.form(2)
That doesn't work becuase it thinks that i'm looking for 1.x equalling "request.form(1) and 2.x = reuqest.form(2)" |
"SELECT * FROM x WHERE 1.x=" & Request.Form("1") & " AND 2.x=" & Request.Form("2")
|
 |