Forums

This topic is locked

Filter a Recordset with a Recordset

Posted 13 Feb 2002 23:24:35
1
has voted
13 Feb 2002 23:24:35 Peter R posted:
I'm trying to filter a recordset with a recordset, but it doesn't seem to be
working for some reason. The following is what I currently have, but it won't retrieve the records I want unless I enter a Default Value that is actually in my db. This of course also causes it to display the records and ONLY the records that match the default value. Of course what I want, is for the default value to be created dynamically depending on the record displayed in rs_sale_details.

SELECT sale_id,sale_client_id,sale_title,sale_start_date,sale_end_date
FROM ss_sales
WHERE sale_client_id='varclientid'

Name -------- Default Value ---- Run-time Value
varclientid --- whatever -------- $rs_sale_details["sale_client_id"]

What it should be doing is get the value from the field "sale_client_id" in the Recordset "rs_sale_details". But it doesn't seem to be doing that. Right now the only way I get any output from the above is if I put valid information into the Default Value field. Like entering "bobsauto"... this will display all records with sale_client_id "bobsauto" but that's all it will display no matter what the sale_client_id actually is in rs_sale_details.

(These two recordsets are pulling info from the same table hence "sale_client_id" in both the SQL and Variable... just to keep that clear)

I'm using PHP/MySQL

Any ideas why it's not pulling variable dynamically?

Peter R

Reply to this topic