B
B
bbaggins2017-01-06 01:53:23
MySQL
bbaggins, 2017-01-06 01:53:23

How to add multiple values ​​to SQL query?

Friends, hello everyone!
Tell me how to add a condition for selecting tags of two types (8 and 4), now only 8 is pulled up. Construction below:

$TagArt->where($db->quoteName('c.type') . ' = 8 AND ' . $db->quoteName('b.id') . ' IN  (' . $LoadTagIrticle . ')');

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Snewer, 2017-01-06
@bbaggins

$TagArt->where($db->quoteName('c.type') . ' IN (4, 8) AND ' . $db->quoteName('b.id') . ' IN  (' . $LoadTagIrticle . ')');

R
Ruslan Fedoseev, 2017-01-06
@martin74ua

do not know sql yet - write your questions in English
select* from table where id =8 or id=4

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question