This topic is locked

Lookup table Where clause

2/26/2009 9:42:37 AM
PHPRunner General questions
J
jetacera author

I have a project in which I want the lookup table to pull in only the records belonging to the logged in user.
The table with the user is called "project" and it has a primary key called "id".
The child table pulled up is called "category" and it has a primary key called "cat_id" and a field called "project_id" to link it to the "id" of the project table.
I entered the following for the where clause:
"project_id="$_SESSION[$strTableName."_masterkey".$i]
When I upload the project I get the following error just going to the URL of my project:
Parse error: syntax error, unexpected T_VARIABLE in /home/root/public_html/webproject/include/commonfunctions.php on line 120
What do I need to do to fix this?
FYI, I'm using PHPR 4.2 with a MySQL database.
I'm wanting the use this where clause in 2 different situations. In the first, I simply want to populate the dropdown with only the categories the user has entered so they can assign items from another table called items to one of their categories.
One other thing I would like to do with this is to have an option that all users can select called "Top Level" as well as just the categories the user has entered. Basically the dropdown in a second case allows the user to choose a parent category for the category they are entering so that the category can be a subcategory if they wish. If they don't want a parent category they would choose "Top Level". I haven't even tried to integrate this idea yet since I'm trying to get the dropdown pulling up correctly first. I imagine I would need to add a user record just for this Top Level option and then include an OR in the Where clause including this option, but I am open to other suggestions of how this could be done.
Thanks.
JET

Sergey Kornilov admin 2/26/2009

Try the following:

" project_id="$_SESSION[$strTableName."_masterkey1"]
J
jetacera author 2/26/2009

I tried it and I get the same error.
Am I using a valid session variable? I got it out of the Help file (the one with the .$i). Is there another way I can pull in this information other than using masterkey?
Thank you.

JET

J
Jane 3/2/2009

Hi,
your code looks correct.

It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.