Skip to main content
Topic: run a php function before page load (Read 1242 times) previous topic - next topic

run a php function before page load

i want to let an agency able to view all his own records and his agents records,

in table Where condition:
failed:
Quote
"agent='". USER_NAME . "' $opt  agency = '". get_active_user('agency') . "'"
working:
Quote
"agent='". USER_NAME . "' or  agency = '". get_active_user('agency') . "'"

i am not able to set a variable $opt before page load... please advice, thanks


 

Re: run a php function before page load

Reply #2
hi, i am not sure if i can use a php variable in the mysql command

i am looking for way to set the variable $opt when page load.

for example, if user role = agency, then i set $opt='or', else $opt='and'

thanks in advance