Jump to content
Sign in to follow this  

SQL Where Using QueryString

Recommended Posts

Hi.I am passing some information over using a QueryString.But i want the next page to lookup the information for that record depending on the QueryString.Its a request system.The first page the users sees they search the database to find what they want. When they find it they click it.The link is setup as

<a href="request.asp?which=<%= rstSearch.Fields("track_id").Value %>">Request</a>

The database has got a code for each track stored in it. I've called it track_id (its a random number and its unique)On the request page i then want this:

<form method="post" action="request_process.asp"><input type="hidden" name="track_id" value="<%=Request.QueryString("track")%>">  <table border="0" cellspacing="0" cellpadding="0">	<tr>	  <td><span class="style7">Requested Track </span></td>	  <td> </td>	  <td><label for="label"></label>	  <input type="text" name="requested_track" value="<%= I WANT THE track_artist SHOWN HERE %> -<%= I WANT THE track_title SHOWN HERE %>">" onFocus="this.blur()"></td>	</tr>	<tr>	  <td><span class="style7">Your Name </span></td>	  <td> </td>	  <td><label for="label2"></label>	  <input type="text" name="your_name">></td>	</tr>	<tr>	  <td><span class="style7">E-Mail Address </span></td>	  <td> </td>	  <td><label for="label3"></label>	  <input type="text" name="email_address"></td>	</tr>	<tr>	  <td><span class="style7">Telephone Number </span></td>	  <td> </td>	  <td><label for="label4"></label>	  <input type="text" name="tel_number"></td>	</tr>	<tr>	  <td><p class="style7">Message To Go With Request<br />  		  <br />		  <br />		  <br />			<br />  		  <br />		  <br />	  </p>	  </td>	  <td> </td>	  <td><label for="label5"></label>		<label for="textarea"></label>	  <textarea name="textarea" rows="5" id="textarea"></textarea></td>	</tr>	<tr>	  <td colspan="3"><div align="center">		<input type="submit" name="Submit" value="-----> Send Request! <-----" id="Submit" />	  </div></td>	</tr>  </table></form>

Obviously i want the artist & title to be shown, but i want it to lookup the track_id number to see who the artist and title is.They are called track_id & track_title & track_artist in the databaseI assume i will need to use an SQl string to lookit up, how do i make it do a where depending on the querystring??Thanks in advance.- Jon

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...