I need a query to check the table with few conditions and return one result:
SELECT
IF(id='123' AND user='alex') FOUND -> return false ELSE -> return true
IF(user='alex') NOT FOUND -> return false
FROM `table`
I have no idea on how to build such query in php function, when it call, result true or false will return
function check(id, user)
{
$q = $mysqli->query("...sql query...");
if($q->num_rows > 0){
return true;
}
return false;
}