title: using "OR" and "AND" mysql php
body: <p>I have a MySQL query, where I want to get a value, lets say <code>m</code> that can be 'x', 'y' or 'z' and two other variables which need to be exact values. I don't know how to write this.</p>
  
  <p>I don't know if you get the idea, but this is what I have:</p>
  
  <pre><code>SELECT * FROM respuestas 
  WHERE id_curso = '155' OR id_curso = '156' OR id_curso= '157' OR id_curso= '158' 
  AND id_pregunta='1' AND respuesta&gt;=0
  </code></pre>
  
  <p>So I need <code>id_curso</code> to be <code>155</code> or <code>156</code> or <code>157</code> or <code>158</code> and at the same time, <code>id_pregunta</code> = <code>1</code> and <code>respuesta</code> > <code>0</code>.</p>
  
  <p>I know this is not the way to write it, but I don't know the right way.</p>