Forums

PHP

This topic is locked

Recordsets Filtering Recordsets

Posted 12 Aug 2002 21:20:39
1
has voted
12 Aug 2002 21:20:39 Jason Baxter posted:
Hi,
I'm using UD4 with PHakt and here's what I want:
On the same page, I want one recordset to be the filter for the other.
In other words:
I have two tables. A column in Recordset 1 (which is filtered by a form on the previous page) is what determines which row is used in Recordset 2.
Any suggestions?

Replies

Replied 14 Aug 2002 09:56:01
14 Aug 2002 09:56:01 Michael Guntenaar replied:
You can do two things.

Make a while loop of your first query

<pre id=code><font face=courier size=2 id=code>
WHILE($meep = mysql_fetch_array($query)) {

Do your second query on the first conditions

}
</font id=code></pre id=code>

Else dig into SQL and go for joins, wich is the best choice for your performance (if you do it right because 1 bad query can be more harmfull than 30 good ones <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> )

Reply to this topic