Hi!
I have 2 tables:
Organization(Org_Id,Name,Address,Phone)
Rooms(Room_Idi,Organization_Idi,Category,Availabil
ity)
The category is a drop down menu which has 4 options, type1,type2,type3 and type4. Availabily has "yes" or "no" inputted into the database for each room in the organization.
I have to output a table which has the following details:
Organization Name,Address,No of rooms available in each category.
I cant seem to get it right. The details from the Organization table seems to be outputted properly but the Rooms table details are not being outputted right. This is my ASP codeI have written to output only type1. I thought if I can output type1, i can output the others easily):
<%
Dim myArray()
numRows = 0
numRows1= 0
Dim temp
Set Cm = Server.CreateObject("ADODB.Command"
Cm.ActiveConnection = "sabesan"
Cm.CommandText = "select Org_Id,Name,Address,no_of_rooms from Organization"
' Creating Connection Object and opening the database
Cm.CommandType = 1
Set RS = Cm.Execute
Do While NOT RS.EOF
numRows = numRows + 1
ReDim Preserve myArray(7, numRows)
temp=RS(0)
myArray(0, numRows - 1) = RS(0)
myArray(1, numRows - 1) = RS(1)
myArray(2, numRows - 1) = RS(2)
myArray(3, numRows - 1) = RS(3)
Cm.CommandText ="SELECT count(*) from Rooms r,Organization o where r.Organization_Idi='temp' and r.room_availability='yes' and r.Category='roomtype1'"
Cm.CommandType = 1
Set RS1 = Cm.Execute
numRows1 = numRows1 + 1
myArray(4, numRows1 - 1) = RS1(0)
RS.MoveNext
Loop
Response.Write("<table border=2>"
For i = 0 to UBound(myArray, 2)
' Response.Write("<tr><td>#" & i & "</td>"
'Response.Write("<td>" & myArray(0,i) & "</td>"
Response.Write("<td>" & myArray(1,i) & "</td>"
Response.Write("<td>" & myArray(2,i) & "</td>"
Response.Write("<td>" & myArray(3,i) & "</td>"
Response.Write("<td>" & myArray(4,i) & "</td></tr>"
Next
Response.Write("</table>"
RS.close
RS1.close
%>
please please help me out???

I have 2 tables:
Organization(Org_Id,Name,Address,Phone)
Rooms(Room_Idi,Organization_Idi,Category,Availabil
ity)
The category is a drop down menu which has 4 options, type1,type2,type3 and type4. Availabily has "yes" or "no" inputted into the database for each room in the organization.
I have to output a table which has the following details:
Organization Name,Address,No of rooms available in each category.
I cant seem to get it right. The details from the Organization table seems to be outputted properly but the Rooms table details are not being outputted right. This is my ASP codeI have written to output only type1. I thought if I can output type1, i can output the others easily):
<%
Dim myArray()
numRows = 0
numRows1= 0
Dim temp
Set Cm = Server.CreateObject("ADODB.Command"
Cm.ActiveConnection = "sabesan"
Cm.CommandText = "select Org_Id,Name,Address,no_of_rooms from Organization"
' Creating Connection Object and opening the database
Cm.CommandType = 1
Set RS = Cm.Execute
Do While NOT RS.EOF
numRows = numRows + 1
ReDim Preserve myArray(7, numRows)
temp=RS(0)
myArray(0, numRows - 1) = RS(0)
myArray(1, numRows - 1) = RS(1)
myArray(2, numRows - 1) = RS(2)
myArray(3, numRows - 1) = RS(3)
Cm.CommandText ="SELECT count(*) from Rooms r,Organization o where r.Organization_Idi='temp' and r.room_availability='yes' and r.Category='roomtype1'"
Cm.CommandType = 1
Set RS1 = Cm.Execute
numRows1 = numRows1 + 1
myArray(4, numRows1 - 1) = RS1(0)
RS.MoveNext
Loop
Response.Write("<table border=2>"
For i = 0 to UBound(myArray, 2)
' Response.Write("<tr><td>#" & i & "</td>"
'Response.Write("<td>" & myArray(0,i) & "</td>"
Response.Write("<td>" & myArray(1,i) & "</td>"
Response.Write("<td>" & myArray(2,i) & "</td>"
Response.Write("<td>" & myArray(3,i) & "</td>"
Response.Write("<td>" & myArray(4,i) & "</td></tr>"
Next
Response.Write("</table>"
RS.close
RS1.close
%>
please please help me out???