|
|
#1 |
|
New Member
Join Date: Aug 2005
Posts: 5
|
Ok, i have a question for you all. I have listed all the data (ado/sql) in a table (asp). But i want to hyperlink each peice of data to a different page with ID. e.g. Column1 data1 > showdata.asp?id=1 data2 > show data.asp?id=2 Column2 asd1 > showasd?id=1 asd2 > showasd?id=2 Please help me on this one. Last edited by hypnotic_monkey; 08-08-2005 at 19:31. |
|
|
|
|
|
#2 |
|
Silent Kristian Konsumer
|
use a normal sized font dude! also 'column'. anyway, welcome. also a little more explaination would be nice.
six
__________________
Desktop: Lian Li PC777, E8400, 8gb, 2 x 500gb (raid 0), GTX260, Dell 23" Laptop: 13" MPB ...the forum is a mess and Forthy just needs to rule it |
|
|
|
|
|
#3 | ||
|
New Member
Join Date: Aug 2005
Posts: 5
|
Using the code:
Quote:
data displayed = 45 link to = page.asp?id=45 Like: Quote:
|
||
|
|
|
|
|
#4 |
|
Registered Trader
Join Date: Jan 2002
Location: Irvine, Ayrshire
Posts: 3,594
|
you wanna use
Code:
Server.CreateObject ("ADODB.Recordset")
|
|
|
|
|
|
#5 |
|
New Member
Join Date: Aug 2005
Posts: 5
|
I have used it.
|
|
|
|
|
|
#6 |
|
WebGuru & Programming Mod
Join Date: May 2003
Location: Farnborough, Hants.
Posts: 1,198
|
Your almost there. All you need to do is mix the two code snippets you posted by changing this part:
Code:
<%
if request.querystring("sort")<>"" then
sort=request.querystring("sort")
else
sort="id"
end if
set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT id, emid, location, title, type FROM tbl_jobs ORDER BY " & sort
rs.Open sql,cString
do until rs.EOF
response.write("<tr width='100'>")
for each x in rs.Fields
response.write("<td width='100'>" & x.value & "</td>")
next
rs.MoveNext
response.write("</tr>")
loop
rs.close
%>
Code:
<%
if request.querystring("sort")<>"" then
sort=request.querystring("sort")
else
sort="id"
end if
set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT id, emid, location, title, type FROM tbl_jobs ORDER BY " & sort
rs.Open sql,cString
while not rs.EOF
%>
<tr>
<td style="padding-left: 8px; padding-right: 8px"><a href="viewid.asp?id=<%=rs("id")%>"><%=rs("id")%></a></td>
<td style="padding-left: 8px; padding-right: 8px"><a href="viewemid.asp?id=<%=rs("emID")%>"><%=rs("emID")%></a></td>
<td style="padding-left: 8px; padding-right: 8px"><%=rs("location")%></td>
<td style="padding-left: 8px; padding-right: 8px"><%=rs("title")%></td>
<td style="padding-left: 8px; padding-right: 8px"><%=rs("type")%></td>
</tr>
<%
rs.MoveNext
wend
rs.close
%>
Last edited by Clarksy; 08-08-2005 at 23:07. |
|
|
|
|
|
#7 |
|
New Member
Join Date: Aug 2005
Posts: 5
|
Thanks
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|