I am using OR in if statement While adding OR its not working. Follow the code :
if(!exists('vouchers','v_id',$generate_id) OR !exists('vouchers','hash',$generate_hash))
{
//Doing something
}
But when I do only one function call its workes.
if(!exists('vouchers','v_id',$generate_id)){//WORK...}
exists function :
function exists($table,$where,$value){
global $db;
$query = $db->query('SELECT * FROM '.$table.' WHERE '.$where.'='.$value.'');
if($query->num_rows == 0) {
return false;
}else{
return true;
}
}
Any helps to fix my code ?