MySQL - IF statement -
my code :
select * `invoices` ( user_id = 3 , status="online" )
but admin id = 1 (user_id=1)
how can allow admin see data?
in such case need 2 sql queries - 1 regular users, 1 admins. in query admins remove where
clause.
application logic (the 1 controls sql queries) should determine user role , based on role should use relevant sql query.
Comments
Post a Comment