This topic is locked

Filtering List Page by a Passed Variable from another table

11/24/2007 12:02:34 AM
PHPRunner General questions
J
jglyn author

Hi,
I'm trying to filter my LIST page using a passed variable from another table.
More specifically, I want people to be able to post comments about other people's posts and see other people's comments for that post at the same time - so when they click on the post, they can simultaneously see previous comments and add a new comment.
On the Comments_Add page, I am doing an <INCLUDE comments_list.php>

  • but I can't figure out how to filter the comments to list only those that correspond to the variable being passed:

    comments_add.php?id=120
    How does the syntax go with the WHERE clause?
  • Josh

Alexey admin 11/26/2007

Josh,
add this snippet to List page:Before SQL queryevent:

if(@$_POST["id"])

$strWhereClause=whereAdd($strWhereClause,"ID = ".$_POST["id"]);

J
jglyn author 11/28/2007

Josh,

add this snippet to List page:Before SQL queryevent:


Thanks, Alexey.
I added that, but I get this on the page where I'm trying to simultaneously ADD new comments and LIST relevant ones:
Technical information

Error type 8

Error description A session had already been started - ignoring session_start()

URL comments_add.php?id=127

Error file /phprunner/include/dbcommon.php

Error line 4

SQL query

Alexey admin 11/29/2007

Josh,
you can not use PHP "include" statement to include one page into another.

Try using frames or iframes for this.