Forum Moderators: coopster

Message Too Old, No Replies

Filtering a recordset with a session variable

Filtering a recordset with a session variable

         

emptiness

4:31 pm on Jun 16, 2004 (gmt 0)

10+ Year Member



Hi all. I have two forms, the Form1 and the Form2. One of the answers in the Form1 is saved in a session variable SesVar1.

In the Form2 there is a dynamic table build with a recordset. I need to filter the recordset of the Form2 with SesVar1.

I tryied to do this using a variable in the recordset window of dreamweaver, writing #SesVar1# in the run-time value of the variables for the recordset, but it didn't work.

Please HELP me out with this one. How can I filter that recordset using the value of a session variable? or the Form1's answer?

Thanks a lot

lorax

8:38 pm on Jun 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Greetings and welcome to WebmasterWorld!

When you say recordset I'm thinking of a MySQL db. If so what't the SQL query? IF not - filter out what exactly? Generic filters for these situations would be like:

SELECT somestuff
FROM sometable
WHERE somefield = '$SesVar1'

or if not a db query

if($SesVar1 == "somevalue") {
do something;
}else {
do this;
}

emptiness

9:34 pm on Jun 16, 2004 (gmt 0)

10+ Year Member



thanks a lot for the welcome lorax.

I just solved that problem a few hours ago. Have a lot of luck actually.

Here's what I did:

$VarProg_precios = "ZO";
if (isset($_POST['programa'])) {
$VarProg_precios = $_POST['programa'];
}

$query_precios = sprintf("SELECT XXX FROM XXX WHERE wmm_precios.CodProgramaMacro = '%s'", $VarProg_precios);

It worked. But now I have another problem: I need to repeat a region inside of another repeated region. Something like this:

Title1
Field1, Field2, Field3 (this is the record1)
Field1, Field2, Field3 (this is the record2)
Field1, Field2, Field3 (this is the record3)

Title2
Field1, Field2, Field3 (this is the record4)
Field1, Field2, Field3 (this is the record5)
Field1, Field2, Field3 (this is the record6)

The title is in the same table as the fields, but I want it to group all the rows with the same title under only one.

Dreamweaver does not support nested repeated regions, so I guess I should do it through PHP. The question is how the "·"$"% jajajaja... I have only two days reading PHP.

PLEASE HELP ME!

thanks a lot my friend

lorax

2:31 pm on Jun 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Where do Fields 1-3 come from?