- #1
- 50
- 0
I get a list from a query. Let's say "SELECT name FROM foods WHERE type='fruit';" returns "apple, orange, banana"
I get a list from another query, "SELECT name FROM concepts WHERE type='color';" returns "red, orange, yellow"
Now what I want is to find the common element(s) in the two lists, in this case "orange."
What is the most efficient way to do this? SQL queries or PHP nested loops, or ?
Thanks.
I get a list from another query, "SELECT name FROM concepts WHERE type='color';" returns "red, orange, yellow"
Now what I want is to find the common element(s) in the two lists, in this case "orange."
What is the most efficient way to do this? SQL queries or PHP nested loops, or ?
Thanks.