next day follow up mysql query find compare two condition in one db table NOT EXISTS

MySQL 0 Comments

next day follow up mysql query find compare two condition in one db table next day follow up mysql query find compare two condition in one db table NOT EXISTS

 

 

$datetime =  date("Y-m-d");
		 $date = date('Y-m-d');
         $prev_date = date('Y-m-d', strtotime($date .' -1 day'));
         $next_date = date('Y-m-d', strtotime($date .' +1 day'));


$showliststid = mysql_query("SELECT cr1.phoneno FROM callcomment AS cr1 WHERE calldateup = '$prev_date' AND callidnext = '$datetime' AND `staffname` = '$calladminid' AND NOT EXISTS ( SELECT phoneno FROM callcomment cr2 WHERE cr2.calldateup = '$datetime' AND cr2.phoneno = cr1.phoneno AND cr2.staffname = '$calladminid') LIMIT 0 , 30");