DATA FILTER AND LOGICAL OPERATORS

QuestionsDATA FILTER AND LOGICAL OPERATORS
Giovanni Luca Bonelli asked 3 years ago

Hi Abu,
I have a problem while filtering or search data when I use logical operator (OR) in sql select_command.

If I write:
$g->select_command = "SELECT * FROM odldiceocc WHERE dlrl='DL/RL' OR cse='CSE'";

The table is correctly populated but autofilter or search button show random, wrong value.

If I write:
$g->select_command = "SELECT * FROM odldiceocc WHERE dlrl='DL/RL'";

autofilter or search button show correct value

How do you think about?

Thankyou in advance

2 Answers
Abu Ghufran answered 3 years ago

You can try putting ( ) around condition.
e.g.
$g->select_command = "SELECT * FROM odldiceocc WHERE (dlrl='DL/RL' OR cse='CSE')";

Luca answered 3 years ago

As always,
It works!

Thanks

Your Answer

14 + 8 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!