Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
120 views
in Technique[技术] by (71.8m points)

php - Filter a MySQL query depending on a column value BUT returning the rest of results that are sharing that specific value

let me explain what I mean on the subject. I have a query to db like this :

"SELECT * from partners WHERE idioma='$lang' OR idioma='EN' ORDER BY id_partner ASC";

This query will return several results, some of them may be repeated because my database has the translations and we have a multilingual webpage in which you can navigate in different languages. Let's say I'm navigating in German, what I need is to show all results that are in English (because I don't always have the translations for all the "partners") but, when I have a result in the specific language, filter that one and only shows the translated result .

I understand that the best option should be to already filter it from database. I can't figure out because everything I've tried so far still shows the EN results. Can you please help ?

Thanks in advance .

question from:https://stackoverflow.com/questions/65898858/filter-a-mysql-query-depending-on-a-column-value-but-returning-the-rest-of-resul

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...