By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 2,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

display mysql records for a hyperlink

P: 17
Hi there,

I have a dynamic hyperlink Baseball. When the user select the hyperlink they are redirected to another page.

After that I want to display information on the page from my linkstbl.

The information I want to display is Baseball and some text I have entered in the database. I'm having a problem displaying the two fields for Baseball.

The two field names are linkdescription and text. How do I get my sql query to pull out the information depending which Hyperlink such as Baseball, Hockey is selected and then display it???

Here is my code that is incorrect so far. This code is on the redirected page.
Expand|Select|Wrap|Line Numbers
  1. <% Dim Conn, RS, query
  2.  
  3.  'Create an ADODB connection
  4.     Set conn = Server.CreateObject("ADODB.Connection")
  5.  
  6.     'Open the database
  7.     conn.Open "Driver={MySQL ODBC 3.51 Driver};Server=24.79.93.78;Database=communitycentre;UID=mona.ramsay;PWD=puke_9;"
  8.  
  9.     'Execute the SQL and assign to our Recordset
  10.     Set rs = Server.createobject("ADODB.recordset")
  11.     query = "SELECT linkdescription, text from linkstbl"
  12.  
  13.     rs.Open query, conn
  14.  
  15.      If Not rs.EOF Then
  16.           Do Until rs.EOF 
  17.                     response.write ("Page.asp?display="("linkdescription")("text") & vbCrLf
  18.                 ' response.write "<br>" & vbCrLf
  19.             rs.MoveNext
  20.             Loop
  21.      Else
  22.         response.write "No records." & vbCrLf
  23.      End If
  24.  
  25.     'Close connections
  26.     rs.Close
  27.     Set rs = Nothing
  28.     conn.Close
  29.     Set conn = Nothing %>
Oct 11 '07 #1
Share this Question
Share on Google+
1 Reply


omerbutt
100+
P: 638
error is at at which line ?,or you are getting the wrong results?
May 3 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.