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.... ::
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'>
&lt;table width="500" border="0" cellspacing="1" cellpadding="0" bgcolor="#9CCF00"&gt;
&lt;tr&gt;
&lt;td bgcolor="#FFFFFF"&gt;
&lt;%
Dim pno
pno = Request.Querystring("p"
s = isnumeric(pno)
If NOT (s) Then
sarr = Split(pno,",",-1,1)
End if
%&gt;

&lt;table width="100%" border="0" cellspacing="1" cellpadding="1"&gt;
&lt;%While ((catrep__numRows &lt;&gt; 0) AND (NOT catinfo.EOF))%&gt;
&lt;tr bgcolor="#EDEDED"&gt;

&lt;%
if catrep__index = 0 Then
%&gt;
&lt;td&gt;&lt;b&gt;Özellik&lt;/b&gt;&lt;/td&gt;
&lt;%
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()
%&gt;

&lt;td&gt;&lt;b&gt;&lt;%=urun.Fields.Item("name".Value%&gt;&lt;/b&gt;&lt;/td&gt;

&lt;%Next%&gt;
&lt;%End If%&gt;

&lt;/tr&gt;
&lt;tr &lt;%If (catrep__index Mod 2) Then response.Write " bgcolor=""#FFFFFF"" " Else Response.Write " bgcolor=""#F7F7F7"" " %&gt; &gt;
&lt;td valign="middle" &gt;&lt;%=catinfo.Fields.Item("info".Value%&gt;&lt;/td&gt;
&lt;%

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()

%&gt;
&lt;td&gt;
&lt;%If Not up.EOF Or Not up.BOF Then%&gt;
&lt;%=up.Fields.Item("info".Value%&gt;
&lt;%Else%&gt;
-
&lt;%End If%&gt;

&lt;/td&gt;
&lt;% Next%&gt;

&lt;/tr&gt;
&lt;%
catrep__index=catrep__index+1
catrep__numRows=catrep__numRows-1
catinfo.MoveNext()
Wend
%&gt;

&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</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

Reply to this topic