Forums

PHP

This topic is locked

recordset.filter using php???

Posted 07 Jan 2002 16:22:19
1
has voted
07 Jan 2002 16:22:19 gustavo troisi posted:
Hi, I want to do this in php:

This is in asp:

Rs1.Filter = "id1 = " & Rs2.fields.Item("id2".value



I tried this, but without success:

$Rs1->Filter = "id1 = " . $Rs2->Fields("id2";

Please help!!!

Replies

Replied 08 Jan 2002 03:36:07
08 Jan 2002 03:36:07 Tim Green replied:
Create the $Rs2 recordset first, then Create the $Rs1 recordset. When creating the $Rs1 recordset, select the id1 column in 'Filter', then Select 'PHP Variable' for value, and in the text box next to that enter:-

Rs2->Fields("id2"

Note the missing $, this has been done purposely, and should be added automatically when you click OK.

However, when creating a recordset in this way, clicking 'Test' probably won't work.

I've not tested this, but give it a go. It *should* work.

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 08 Jan 2002 04:26:19
08 Jan 2002 04:26:19 gustavo troisi replied:
Thank you.
But my intention was to filter one of the recordsets after I have created both recordsets.
I could do it in asp, but not in php. Maybe it is not possible in one code line...?
Thank you again.

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Create the $Rs2 recordset first, then Create the $Rs1 recordset. When creating the $Rs1 recordset, select the id1 column in 'Filter', then Select 'PHP Variable' for value, and in the text box next to that enter:-

Rs2-&gt;Fields("id2"

Note the missing $, this has been done purposely, and should be added automatically when you click OK.

However, when creating a recordset in this way, clicking 'Test' probably won't work.

I've not tested this, but give it a go. It *should* work.

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 08 Jan 2002 08:53:56
08 Jan 2002 08:53:56 Tim Green replied:
You have a couple of options in that case, depending on what you are going to do with the data.

If you are just going to display the data then use the Conditional Region behaviour, and apply the DBField to DBField behaviour to the page comparing the 2 columns from the recordsets.

Otherwise, if you need all of this information in a recordset, then create your 2 recordsets as you would, and then create a 3rd recordset using the information previously posted.

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>

Reply to this topic