473,796 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

display mysql records for a hyperlink

17 New Member
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 1755
omerbutt
638 Contributor
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
1659
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 of display. ( This is very much equal to set line size 15 in oracle) . can any one Help ASAP. Thanks in Advance.
3
3128
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 in the form and hits the submit button, the data is entered and the form is reloaded with the new data displayed and another input form becomes the last line. Example --- Before entering new data
3
3189
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 to select a given record(hyperlink), and display all of the fields for that record on another webpage so I can execute some code against it. Can anyone point me to some sample code so I can get an idea of how to accomplis this? Thanks in...
4
3435
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 homepage. Also, when the user clicks on the description hyperlink they should see a dropdown with other hyperlinks such as hockey, baseball, etc. Here is what I have so far. I am new to asp and mysql, I would really appreciate the help. % ...
1
2531
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 format the way the entries are displayed from the database using nl2br2($string) to properly display paragraph breaks.
5
2907
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 the Programs hyperlink is selected I would like a drop down of link from my programs mysql table to be displayed. So far, it takes my mysql data and puts it as link but on it's own. I'm not sure how to put it under my Programs hyperlinks. Also...
8
2344
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 action="index.php"". 2nd page(index.php) has the mysql queries and gives a brief information(one line) about the user query. Now the index.php has a hyperlink to the third page(summary.php) which gives detailed information about the user query. 3rd...
1
1183
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 + "/"; Than it display records getting different page no. . and the pageNo of hplNext get different value. But the problem is that it some time shows the url like SectionName /2/3/ but actually it should display like SectionName/3/ . Please suggest me how...
7
1944
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' /aspcodes/DisplayROwsHorizon/index.asp, line 26 Loop
0
9528
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10173
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10006
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.