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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -