Welcome to WebmasterWorld Guest from 188.8.131.52
Forum Moderators: ocean10000
The prog is good for quickly getting some database results on the go...the query is run of the mill...a primary key equalling "whatever" to display the particular contents of the page.
The primary key will be the URL, since all pages will need a unique URL. I found out to acquire the URL I can use the below request
<%= Request.ServerVariables("URL") %>
Using this code simply prints it out, which is fine. But I want to put the contents of that variable in the HERE bit below
fp_sQry="SELECT * FROM table WHERE (id = 'HERE')"
Hopefully it will save some hassle over the long term, but I'm not sure of the syntax here....I know I simply can't copy and paste code bit #1 into the query....as it thinks all the code inside the single quotes is the WHERE statement.
Can an ASP wizard be so kind to correct me on the syntax to fit the funky variable into the query? :)
Thanks for the replies in advance!
I get a "page cannot be displayed" with the error "Expected end of statement" with both your methods.
I noticed by adding an extra comma after the id= bit- I managed to get the page displayed using your 2nd example, though I get this :
Syntax error (missing operator) in query expression '(id ='.
Just a little syntax error? :) I would not know any better....
The whole statement is used in an included .asp page if that applies at all in the case of acquiring the URL here