search per column when there are duplicates

Questionssearch per column when there are duplicates
BiLe asked 3 years ago

Hello,

I have noticed the following with the grid.

I have a “text” field which is a title. E.g.:

1. This is a title
2. This is another title

In database I Select unique titles and search per column works.

However, when I Select all titles and duplicates, search per column does not filter the list.

1. This is a title
2. This is a title
3. This is another title
4. This is another title

A searchable column has to be unique?

3 Answers
BiLe answered 3 years ago

I think I have just found the reason:

$g->select_command = “SELECT
id,
title,
theme,
published
FROM
custom_joomla_pages
WHERE
app_id = 6
OR
app_id = 17
“;

Because II am using a WHERE with my custom sql query, it looks like the search can’t handle duplicates.

Is there a better way of writing my WHERE clause, so search will not be interfered with?

Abu Ghufran Staff answered 3 years ago

Hello,

I guess you need to enclose the OR conditions in ( ) so new conditions are AND’ed with the whole block:

WHERE (
app_id = 6
OR
app_id = 17 )

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
BiLe answered 3 years ago

Correct. Works!

Thank you.

Your Answer

7 + 5 =

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?