Reading from a DB and creating links from the resu
I have a database where one of the tables has the info about the users. I have a page that reads the users name, and I wanna be able to reveal the rest of the info of the users when I click on their names, how can I do this.
do you have an autonumber field in your db??<BR><BR>if "yes" then<BR><%<BR>set dbcn=server.createobject("adodb.connection")<BR>db cn.open "dsn=mydsn"<BR>sql="select autonumberfield,username from mytable order by autonumber desc"<BR>set rstemp=dbcn.execute(sql)<BR>do while rstemp.eof<BR>autonumber=rstemp("autonumberfield") <BR>username=rstemp("username")<BR>response.writ e "<a href='file.asp?userid=" & autonumber & "'>" & username & "</a><BR>"<BR>rstemp.movenext<BR>loop<BR>dbcn.cl ose<BR>set dbcn=nothing<BR>%><BR><BR>on file.asp:<BR><%<BR>userid=request.querystring ("userid")<BR>set dbcn=server.createobject("adodb.connection")<BR>db cn.open "dsn=mydsn"<BR>sql="select * from mytable where autonumberfield=" & userid<BR>set rstemp=dbcn.execute(sql)<BR>'variables=rstemp( "dbfields")<BR>'display info<BR>dbcn.close<BR>set dbcn=nothing<BR>%><BR><BR>if not...good luck!!
Ender: Thank you, I do have identifiers and I never thought it was so simple to do this... also your code helped me understand better some other stuff. I'll be able to enhance my code...<BR><BR>Bill: You're totally right, and I usually check the other threads before asking. I also chose a couple of random ones each day to try to improve my knowledge, since I'm really new to this. The reason I didn't check that thread was the tittle didn't seem too related to my problem, though I'd would have read it sooner or later because I usually read most threads where you post, since you have helped me before. Anyway thanks for your patience!