If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Inserting query Responses into a form table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-09-05, 07:00
parmy parmy is offline
Registered User
 
Join Date: Jan 2005
Posts: 18
Question Inserting query Responses into a form table

Hi guyz i wanted to ask if anyone knows how to insert data from a query into a table in a form. I am using ASP and mysql for the db.

I havn't a clue how to start tackling this one. Do i need to create a table first hand or can i run a script which creates the table as it displays the query... so that the script creates the numbers of rows in the form tabel to match the number of rows returned by the query? I want to return the top 3 rows from my table using the nearest date and display these.

I'd be greatful for any pointers or links where this process is explained. Thanks alot.
Reply With Quote
  #2 (permalink)  
Old 03-09-05, 09:13
plsh plsh is offline
Registered User
 
Join Date: Nov 2004
Posts: 253
Am I correct in asuming you want to display the results from a query in a table in asp?? The resultset is what you want displayed?
Reply With Quote
  #3 (permalink)  
Old 03-09-05, 10:24
parmy parmy is offline
Registered User
 
Join Date: Jan 2005
Posts: 18
display query results

Yes thats right, i want to display the query results. Sorry if i didnt make any sense.
Reply With Quote
  #4 (permalink)  
Old 03-09-05, 22:03
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
Perhaps check this out:

Database GetRows
http://www.asp101.com/samples/db_getrows.asp

And perhaps check out the other database samples at www.asp101.com/samples
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
  #5 (permalink)  
Old 03-10-05, 02:03
plsh plsh is offline
Registered User
 
Join Date: Nov 2004
Posts: 253
This is perhaps not the best solution but works for me:

Code:
<table>
<%
While not recordset.eof
  response.write "<tr><td>" & recordset("fieldname") & "<\td><\tr>"
  recordset.movenext
Wend
%>
</table>
Very basic example, but should give you an idea.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On