Jump to content

SQL Where Using QueryString


musicradiolive

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...