edit the recordset using advanced view.
change the where clause:
WHERE id = Paramid
to:
WHERE id = Paramid AND id = Paramdirectoryid
in the variables section, add a new variable as:
Name: Paramdirectoryid
Type: integer
default Value: -1
Runtime Value: $_SESSION['directoryid']
you may need to add the following code at line 1 for the session to work:
<?php @session_start(); ?>