I have added new columns to my news table more_news
including the columns, language, type_cover
.
When I WHERE c.active=?
try to add a AND c.language=?
but it shows me the following message: An error occurred in the query
$strSQL="SELECT
c.title_category,
GROUP_CONCAT(COALESCE(n.mini_title,''),'≠',COALESCE(n.url,'') SEPARATOR '|') data
FROM category c
INNER JOIN news_more n ON c.id_category=n.id_category
WHERE c.active=?
GROUP BY c.id_category
LIMIT 10";
I don't know if the procedure is adequate, I don't know how to work very well with joined tables, this procedure is born from the following answer & question .
I describe the structure of the tables:
Table:category
id_category title_category active
1 PREMIER LEAGUE 1
2 CUP AMERICA 1
Table:news_more
id_one_more_news country region language id_category active
1 global es 1 1
2 global es 1 1
3 co en 1 1
So I need to weigh more conditions WHERE
between them I want to show only the data that is in the English language taking data from the column language
-> en
.
If later you wish to apply other conditions, you can explain to me what the processes and changes to follow are.
In the example you gave, if you want to add another parameter you would do it like this: