Query to MySQL

How to query MySQL to print the value if in_nol = $id_alex $id_max?

$result = mysql_query("SELECT name, surname, str, int, id_nol FROM datacenter WHERE surname = '$surname_alex' AND type = 'scholar' AND id_nol = '$id_alex', '$id_max'");

Answer 1, authority 100%

SELECT name, surname, str, int, id_nol FROM datacenter WHERE surname = '$surname_alex' AND type = 'scholar' AND id_nol IN ('$id_alex', '$id_max')

IN operator.


Answer 2

it seems to say in the condition about the “AND” operator, so neither IN nor OR is suitable)
A simple AND

is enough

SELECT name, surname, str, int, id_nol FROM datacenter WHERE surname = '$surname_alex' AND type = 'scholar' AND ( id_nol ='$id_alex' AND id_nol = '$id_max')