Forums
This topic is locked
Displaying Selected records
Posted 19 May 2002 02:36:36
1
has voted
19 May 2002 02:36:36 Suat donangil posted:
I have two pages. Page 1 lists all the data in my database. I want to select the records that i want using checkboxes and see them on the second page(comparing). Is there a tutorial about this or any help how to do that?Replies
Replied 20 May 2002 01:24:56
20 May 2002 01:24:56 Andrew Watson replied:
Ive just written a wee tutorial that shows how to select, using checkboxes, nultiple records on one page and then goto page which deletes them.
This could easiy be altered to show them instead of delete them.
The tutorial has not been vetoed yet but i hope it will very soon.
Cheers ,
LEED
:: Son, im Thirty.... ::
This could easiy be altered to show them instead of delete them.
The tutorial has not been vetoed yet but i hope it will very soon.
Cheers ,
LEED
:: Son, im Thirty.... ::
Replied 20 May 2002 03:30:50
20 May 2002 03:30:50 Suat donangil replied:
thanx for responding. I have read your tutorial. helpful for the first part. But not enough to build the second part that displays the selected results. Can u help me pls.?
Replied 21 May 2002 12:02:49
21 May 2002 12:02:49 Some One replied:
I'm posting really hard code below ! Explore and find your way.. Also you can check out online version of this code (www.hemenal.com/kategori.asp?kategori=64) -Beta Site
Check both of them and push "karsilastir" button !
p.s : I'm using arrays for repeating records
If you have any problems (i think you will hav <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> please ask.
CODE
----------------------
<font face='Courier New'>
<table width="500" border="0" cellspacing="1" cellpadding="0" bgcolor="#9CCF00">
<tr>
<td bgcolor="#FFFFFF">
<%
Dim pno
pno = Request.Querystring("p"
s = isnumeric(pno)
If NOT (s) Then
sarr = Split(pno,",",-1,1)
End if
%>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<%While ((catrep__numRows <> 0) AND (NOT catinfo.EOF))%>
<tr bgcolor="#EDEDED">
<%
if catrep__index = 0 Then
%>
<td><b>Özellik</b></td>
<%
For i = 0 To Ubound(sarr)
set urun = Server.CreateObject("ADODB.Recordset"
urun.ActiveConnection = MM_sinpa13_STRING
urun.Source = "SELECT * FROM products WHERE product_id = " & sarr(i)
urun.CursorType = 0
urun.CursorLocation = 2
urun.LockType = 3
urun.Open()
%>
<td><b><%=urun.Fields.Item("name".Value%></b></td>
<%Next%>
<%End If%>
</tr>
<tr <%If (catrep__index Mod 2) Then response.Write " bgcolor=""#FFFFFF"" " Else Response.Write " bgcolor=""#F7F7F7"" " %> >
<td valign="middle" ><%=catinfo.Fields.Item("info".Value%></td>
<%
For i = 0 To Ubound(sarr)
set up = Server.CreateObject("ADODB.Recordset"
up.ActiveConnection = MM_sinpa13_STRING
up.Source = "SELECT * FROM pinfo WHERE product_id = " & sarr(i) & " AND catinfo_id = " & catinfo.Fields.Item("catinfo_id".value
up.CursorType = 0
up.CursorLocation = 2
up.LockType = 3
up.Open()
%>
<td>
<%If Not up.EOF Or Not up.BOF Then%>
<%=up.Fields.Item("info".Value%>
<%Else%>
-
<%End If%>
</td>
<% Next%>
</tr>
<%
catrep__index=catrep__index+1
catrep__numRows=catrep__numRows-1
catinfo.MoveNext()
Wend
%>
</table>
</td>
</tr>
</table>
</font id='Courier New'>
----------------------------
Ferruh Mavituna : Freelance web developer & designer
Check both of them and push "karsilastir" button !
p.s : I'm using arrays for repeating records
If you have any problems (i think you will hav <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> please ask.
CODE
----------------------
<font face='Courier New'>
<table width="500" border="0" cellspacing="1" cellpadding="0" bgcolor="#9CCF00">
<tr>
<td bgcolor="#FFFFFF">
<%
Dim pno
pno = Request.Querystring("p"
s = isnumeric(pno)
If NOT (s) Then
sarr = Split(pno,",",-1,1)
End if
%>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<%While ((catrep__numRows <> 0) AND (NOT catinfo.EOF))%>
<tr bgcolor="#EDEDED">
<%
if catrep__index = 0 Then
%>
<td><b>Özellik</b></td>
<%
For i = 0 To Ubound(sarr)
set urun = Server.CreateObject("ADODB.Recordset"
urun.ActiveConnection = MM_sinpa13_STRING
urun.Source = "SELECT * FROM products WHERE product_id = " & sarr(i)
urun.CursorType = 0
urun.CursorLocation = 2
urun.LockType = 3
urun.Open()
%>
<td><b><%=urun.Fields.Item("name".Value%></b></td>
<%Next%>
<%End If%>
</tr>
<tr <%If (catrep__index Mod 2) Then response.Write " bgcolor=""#FFFFFF"" " Else Response.Write " bgcolor=""#F7F7F7"" " %> >
<td valign="middle" ><%=catinfo.Fields.Item("info".Value%></td>
<%
For i = 0 To Ubound(sarr)
set up = Server.CreateObject("ADODB.Recordset"
up.ActiveConnection = MM_sinpa13_STRING
up.Source = "SELECT * FROM pinfo WHERE product_id = " & sarr(i) & " AND catinfo_id = " & catinfo.Fields.Item("catinfo_id".value
up.CursorType = 0
up.CursorLocation = 2
up.LockType = 3
up.Open()
%>
<td>
<%If Not up.EOF Or Not up.BOF Then%>
<%=up.Fields.Item("info".Value%>
<%Else%>
-
<%End If%>
</td>
<% Next%>
</tr>
<%
catrep__index=catrep__index+1
catrep__numRows=catrep__numRows-1
catinfo.MoveNext()
Wend
%>
</table>
</td>
</tr>
</table>
</font id='Courier New'>
----------------------------
Ferruh Mavituna : Freelance web developer & designer
Replied 21 May 2002 15:12:11
21 May 2002 15:12:11 Suat donangil replied:
Thanks a lot. Very helpful
Replied 22 May 2002 12:33:07
22 May 2002 12:33:07 Some One replied:
You are welcome <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Ferruh Mavituna : Freelance web developer & designer
Ferruh Mavituna : Freelance web developer & designer