This is a discussion on "Selecting database records using the QueryString" within the Classic ASP section. This forum, and the thread "Selecting database records using the QueryString are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Selecting database records using the QueryString
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Selecting database records using the QueryString
Ok, can anyone please explain this to me
|
|
|
|
|||
|
sSQL = "SELECT whatever FROM wherever WHERE userid=" & request.querystring("id")
mypage.asp?id=5 |
|
|||
|
thats it Court Jester
|
|
|||
|
ok, I see the code, but how do I get that to work for me? Where do I place that code? Does it go as a part of my link? Still confused.. thanks.
|
|
||||
|
Court Jester... you really have answered your own question here in your initial post.
You include the ID of the item you want from the database in your link (as a querystring)... eg:- mypage.asp?id=272 and then use the SQL select statement you posted to get at the element in the db who's id matches. you can pull whatever data you need to from the database (i know you know how to do that, so wont go into it) and display it.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
for example:
|
|
|||
|
COOL! Thanks Rob for taking the confusion away
|
|
|||
|
hrmmm I tried the code you gave me smokie, and while I understand what it does and all.. the way you did it is a lot different then I normally do it. I am getting an error on line 16 which is this:
ohhh and this is the error.... Microsoft VBScript runtime error '800a01a8' Object required: 'Provider=MSDASQL.1;E' /tests/querystrings.asp, line 16 |
|
|||
|
try this:
|
|
|||
|
Thanks a ton Smokie. It works great! Thanks so much for your help!
|
|
|||
|
|
![]() |
| Tags |
| selecting, database, records, using, querystring |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing wildcards in a querystring | jayaime | Classic ASP | 0 | Oct 11th, 2006 19:02 |
| var = Request.QueryString(item) - why doesn't this work?! | Donny Bahama | Classic ASP | 7 | Jun 17th, 2006 08:43 |
| Selecting Numbers | WillisTi | Flash & Multimedia Forum | 1 | Nov 16th, 2005 16:56 |
| request.querystring | breeze76 | Classic ASP | 5 | Oct 16th, 2005 14:35 |
| PLEASE HELP - Passing Variables in Querystring | just_the_basix | Classic ASP | 40 | Sep 3rd, 2004 10:46 |