ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 9th, 2003, 04:11 PM
aspuser25 aspuser25 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 141 aspuser25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Cool a very simple table problem!

i am tryign to print a table with values from db using radio buttons. what is happening is the heading is getting repeated as many records i have and also my radio button is falling under my 1st column of a table whereas i want it outside my table...extreme left ....its a simple prob ... but struggling up and down since past 30 mins

any suggestions? thanks in advance!

My code:

<%
DIM SQL
DIM RSA
DIM RSA2
DIM BGC
dim iCount

iCount = 0
set RSA = Server.CreateObject("ADODB.Recordset")
RSA.OPEN "SELECT sc.student_id,st.story_name,si.student_name,sc.story_id, sc.status_student FROM student_content sc, student_info si, story_table st where (sc.student_id = si.student_id and sc.story_id = st.story_id)", "DSN=school"
'RSA.open "select * from student_content", "dsn=school"


'set rsa2 = server.createobject("adodb.recordset")
'rsa2.open "select student_name from student_info where student_id='"&session("loggedID")&"'", "dsn=school"
Do while not RSA.EOF
%>

<html>
<head>
<title> none </title>
</head>
<body>
<form method="post" action="doc1.asp" name="teacher">

<table border>
<td>Student ID</td>
<td>Student Name</td>
<td>Story ID</td>
<td>Story Name</td>
<td>Student Story Status</td>

<tr>
<td><input type=radio name=RR value=<%=RSA.Fields ("story_id").Value%>;<%=RSA.Fields ("student_id").Value%>></input> <%= RSA.Fields ("student_id").Value %></td>
<td> <%= RSA.Fields ("student_name").Value %></td>
<td> <%= RSA.Fields ("story_id").Value %></td>
<td> <%= RSA.Fields ("story_name").Value %></td>
<td> <%= RSA.Fields ("status_student").Value%></td>
</tr>

</table>


</body>
</html>
<%
iCount = iCount + 1
rsa.movenext
loop
%>
<p align="center">
<input type="submit" value="Submit" name="submit"></p>

Reply With Quote
  #2  
Old September 9th, 2003, 06:47 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
wooooaaaaah, aspuser, take a step back and examine your program more closely before posting

if you're header is repeated as many times as records, your printing out the header inside the loop arn't ya? You need to pring out the heading information of the table, do the loop for the body, and then after the loop is over, then you close the table. You also never established < tr> and </ tr> for the table header. If you want your radio buttons outside the table why are you putting it in the cell? You can't start the table, close it, print the radio buttons, and then continue the table, that's just not possible. Take a step back, look at what you need to do, and then sit back down and continue coding, i think you've just confused yourself and it's pretty easy once you step back and look at it.

Reply With Quote
  #3  
Old September 9th, 2003, 07:30 PM
aspuser25 aspuser25 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 141 aspuser25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
i tried what u said but that doesnt give me the desierd result. the first row i get as i want, but from 2nd i dont get under the headings..tehy are displayed one after the other. :-(

<%
DIM SQL
DIM RSA
DIM RSA2
DIM BGC
dim iCount

iCount = 0
set RSA = Server.CreateObject("ADODB.Recordset")
RSA.OPEN "SELECT sc.student_id,st.story_name,si.student_name,sc.story_id, sc.status_student FROM student_content sc, student_info si, story_table st where (sc.student_id = si.student_id and sc.story_id = st.story_id)", "DSN=school"
'RSA.open "select * from student_content", "dsn=school"


'set rsa2 = server.createobject("adodb.recordset")
'rsa2.open "select student_name from student_info where student_id='"&session("loggedID")&"'", "dsn=school"
%>

<html>
<head>
<title> none </title>
</head>
<body>
<form method="post" action="doc1.asp" name="teacher">
<table border>
<td>Student ID</td>
<td>Student Name</td>
<td>Story ID</td>
<td>Story Name</td>
<td>Student Story Status</td>
<%
Do while not RSA.EOF
%>
<tr>
<td><input type=radio name=RR value=<%=RSA.Fields ("story_id").Value%>;<%=RSA.Fields ("student_id").Value%>></input> <%= RSA.Fields ("student_id").Value %></td>
<td> <%= RSA.Fields ("student_name").Value %></td>
<td> <%= RSA.Fields ("story_id").Value %></td>
<td> <%= RSA.Fields ("story_name").Value %></td>
<td> <%= RSA.Fields ("status_student").Value%></td>
</tr>

</table>
</body>
</html>
<%
iCount = iCount + 1
rsa.movenext
loop
%>
<p align="center">
<input type="submit" value="Submit" name="submit">
</p>

Reply With Quote
  #4  
Old September 9th, 2003, 07:44 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
A) you didn't step back and look =P
B) you didn't add the <tr> tags around the table header
C) you are still closing the table in each loop, remember
print table header
loop print table contents end loop
print table footer
D) i don't know what you're errors are, that should work but if you're still getting undesired results can you give me a link to the page to view the error?

Reply With Quote
  #5  
Old September 9th, 2003, 10:21 PM
aspuser25 aspuser25 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 141 aspuser25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
i dont know what exactly u r tryign to tell .. but i did try put the form tag away from loop no help...

here is my link ... if u can suggest
http://218.186.133.61:8888/myweb2/loginDB.asp

username = teacher
password = teacher

Reply With Quote
  #6  
Old September 10th, 2003, 12:19 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
i see no problem with the site....

Reply With Quote
  #7  
Old September 10th, 2003, 12:30 AM
aspuser25 aspuser25 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 141 aspuser25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
there is no error? probably i wasnt clear. but i am not getting hte desired results.
like hte headings are repeated for every row??? with as many radio buttons there are as many headings are there? i dont want this.

also the radio button is coming under the 1st column?

i hoep i am clear

Reply With Quote
  #8  
Old September 10th, 2003, 12:36 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
try this
Code:
<% 
DIM SQL 
DIM RSA 
DIM RSA2 
DIM BGC 
dim iCount 

iCount = 0 
set RSA = Server.CreateObject("ADODB.Recordset") 
RSA.OPEN "SELECT sc.student_id,st.story_name,si.student_name,sc.story_id, sc.status_student FROM student_content sc, student_info si, story_table st where (sc.student_id = si.student_id and sc.story_id = st.story_id)", "DSN=school" 
'RSA.open "select * from student_content", "dsn=school" 


'set rsa2 = server.createobject("adodb.recordset") 
'rsa2.open "select student_name from student_info where student_id='"&session("loggedID")&"'", "dsn=school" 
%> 

<html> 
<head> 
<title> none </title> 
</head> 
<body> 
<form method="post" action="doc1.asp" name="teacher"> 
<table border> 
<tr>
<td>Student ID</td> 
<td>Student Name</td> 
<td>Story ID</td> 
<td>Story Name</td> 
<td>Student Story Status</td> 
</tr>
<% 
Do while not RSA.EOF 
%> 
<tr> 
<td><input type=radio name=RR value=<%=RSA.Fields ("story_id").Value%>;<%=RSA.Fields ("student_id").Value%>></input> <%= RSA.Fields ("student_id").Value %></td> 
<td> <%= RSA.Fields ("student_name").Value %></td> 
<td> <%= RSA.Fields ("story_id").Value %></td> 
<td> <%= RSA.Fields ("story_name").Value %></td> 
<td> <%= RSA.Fields ("status_student").Value%></td> 
</tr> 
<%
rsa.movenext 
loop
%>
</table> 
</body> 
</html>  


you cannot make the radio button appear outside of the table/ i don't understand why you would want to. It would require fancy formatting which i will not do for you. I don't understand why you have a problem with the radio buttons being in the table. you'll need some unique identifier per row....

Reply With Quote
  #9  
Old September 10th, 2003, 12:42 AM
aspuser25 aspuser25 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 141 aspuser25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Thumbs up

got it thanks!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > a very simple table problem!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT