Hi,
I'am making a selection query for an export on a custom PHP page.
For this I query the view "myproducts". This view contains a column 'userID'.
I only want to select the records where the userID is the same as the userID of the currently login user. I used the advanced security, where I selected the tblusers and the id collum as userid.
So it would look something like:
$tablename = "myproducts";
$sql = "SELECT * from $tablename WHERE UserID = $CurrentUserID"
But CurrentUserID is not a known variable. So my questions are:
- how do I obtain the current userID variable?
- how can I integrate this in the sql statement?
Please help me in the right direction!