473,395 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

display mysql records for a hyperlink

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
1 1735
omerbutt
638 512MB
error is at at which line ?,or you are getting the wrong results?
May 3 '08 #2

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

Similar topics

0
by: sjonnalagadda | last post by:
Hello All, By default Mysql select statement displays column names header only once at the first row. I want the column names for the select statment to be displayed after every say 15 rows...
3
by: Bob Sanderson | last post by:
I am trying to create a form for a MySQL database similar to a spreadsheet. The idea is to display a list of records, with the last line of the list being an input form. When the user enters data...
3
by: BOBss | last post by:
I am using ASP with VBScript. I want to query an access database username field, and display the output as a hyperlink on an a webpage.The webpage will display all records. I then need to be able...
4
by: mramsay | last post by:
Hi, I'm having a real problem creating a dynamic hyperlink for my website. I want to pull the field name from mysql table. Field name is description. I would like this to be a hyperlink on my...
1
by: xx75vulcan | last post by:
Hi, Not sure if this goes to PHP or mySQL group (or both!). I've got a home brewed blog started using PHP and mySQL to store and display the entries/postings. I've figured out that I could...
5
by: mramsay | last post by:
HI, I'm having alot of problems trying to figure out how to create drop down links from a hyperlink on my homepage. I have a hyperlink called Programs (this is for a community centre) When...
8
by: kumarboston | last post by:
Hi All, I have a mysql database and 3 pages which queries and returns the data. 1st page(main.html) is just a form in html which takes query from the user and is connected to "form...
1
by: subratdasmohapatra | last post by:
I set the navigate url as hplNext.NavigateUrl = "~/" + SectionName + "/" + pageNo + "/"; But when I click previous hyperlink as hplPrev.NavigateUrl = "~/" + SectionName + "/" + pageNo + "/"; ...
7
by: iahamed via WebmasterKB.com | last post by:
Hi all, I need to display records Horizontally, I do not know for some reason this code gives me an error, uses an access db. Microsoft VBScript compilation (0x800A040E) 'loop' without 'do'...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.