MySQL Forums
Forum List  »  Security

global variable
Posted by: Martin Williams
Date: August 05, 2014 02:41PM

Hello, Im a newbie,
Im haveing an issue with a query, Here is my exacty syntax

select * from db where user_login = %current_user_id%

and this isnt working.

I was told
"if you would like to user current user's ID in the query (eg, to show records

from some table only for the currnt user) you can use the placeholder

%CURRENT_USER_ID% it will be replaced with the actual ID value of the

currently logged in user at runtime moment.

so, select * from db where user_login = %CURRENT_USER_ID% will be sent as

select * from db where user_login = 1
(if current user has an id of 1)"

but its not working

Im using phpmyadmin and running the syntax in there

Please help,,

Options: ReplyQuote

Written By
global variable
August 05, 2014 02:41PM
August 05, 2014 04:22PM
August 07, 2014 02:08PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.