prepare($query); $sth->execute($fields); if ( ($newtarget == 0) || (false !== ($row = $sth->fetch())) ) { $_SESSION['queuetarget'] = $newtarget; } header('Content-Type: application/json'); echo json_encode($_SESSION['queuetarget']); exit(); ?>