PHP (here if statement) in server side script possible?
PHP (here if statement) in server side script possible?
Rappi
Posts: 82Questions: 18Answers: 1
Hi.
I give some variables to my server side script and want to make a where condition only if variable is set.
Can I make a php if statement in this script? Or is there another solution?
I need this and this is not working:
if($aktiv == '1'){
->where( 'tm_pflegestellen.Aktiv', $aktiv, '=')
}
if($schulung == '1'){
->where( 'tm_pflegestellen.Schulung', '0000-00-00', '=')
}
Thanks
Rappi
This question has accepted answers - jump to:
This discussion has been closed.
Answers
You would just break the chain:
Allan
Great!
Thanks Allan.
I'am again.
Now I have all working but the OR condition isn't working :-(
Can you help me one more time, please?
it show an error "Notice: Undefined variable tierart in these lines:
I think the reason is the missing $editor ?!?
But how can I write this function otherwise?
Rappi
You need to use the
use
statement in PHP to accessible variables inside anon functions. See the PHP documentation.Allan