This topic is locked

Session handling problem

11/12/2007 10:56:33 AM
PHPRunner General questions
scuba author

Hi everyone,
I'm trying to create a field that automatically detects any user changing a query. I've set up a Lookup-Table with the column "user_id" - this also is the OwnerID field for login. Setup is like:

Display Field = user_id / Link Field = user_id / WHERE "user_id =" . $_SESSION["OwnerID"]
Then I get this error in the browser: Unknown column 'RolHam' in 'where clause'
The where clause detects the OwnerID correctly but for some reason identifies it as a missing column??!?
Anybody any idea what is going wrong? thanks in advance

A
alang 11/12/2007

Try using backquote (`) around your field names and single quote(') around the values. ie
"`user_id`='". $_SESSION["OwnerID"]."'"

scuba author 11/13/2007

Try using backquote (`) around your field names and single quote(') around the values. ie

"`user_id`='". $_SESSION["OwnerID"]."'"


Thanks AlanG but that doesn't work - gives out "Parse error: parse error, unexpected '=' in....."

I just don't get the point why the hell this doesn't work. Also I've tried with ...["_OwnerID"] but failed to.

DESPERADOS !!!! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=23306&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

scuba author 11/13/2007

What's the difference between OwnerID and UserID??

Alexey admin 11/13/2007

$_SESSION["OwnerID"] contains OwnerID value used for advanced security

$_SESSION["UserID"] contains Username of currently logged in user.

scuba author 11/15/2007

I really don't wanna bother you guys - but is anyone aware of a solution for my problem (read top post)? I've been trying to solve this for the last 3 days, my wisdom has reached an end <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=23366&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />

any suggestions and comments welcome!!

Alexey admin 11/15/2007

Hi,
Alan gave you the advice which is 100% correct.

Make sure you didn't misspell the code.
If nothing helps publish your project on Demo account and send a link to it to support@xlinesoft.com along with the problem description.

scuba author 11/15/2007

Thanks Alexey, I'll try again.

I have a new approach on this. I canceled the idea of a lookup-table and just set up a read-only field with this code as default: @$SESSION["" . $strTableName."_OwnerID"]

works fine - but of course only on Add-page. How can I implement this into Edit-page, maybe by Events? And is it possible to insert UserID instead of OwnerID? I tried but couldn't handle it.

thanks for your help guys!!

Alexey admin 11/15/2007

Hi,
I suppose here you need to use this code in Before record updated event:

$values["FieldName"]=$_SESSION["OwnerID"];

or

$values["FieldName"]=$_SESSION["UserID"];

scuba author 11/15/2007

I LOVE YOU DUDE!!!! You saved my meeting for next week!! I promise I'll buy the next update - 1000 thanks!!! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=23379&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' />