I am trying to grab records from a 'Requests' table by a date using an $id and $rDate variables. When the code is commented out the program works normally without grabbing the records. The problem is once the code, even just echoing a string, stops the display halfway through another loop. The question I have is does this code have a syntax error because I cannot determine the issue even when just displaying a string.
Code:
echo "SELECT * FROM `Requests` WHERE idEmployees = $id AND rDate = '$rMon'"; // bombs out
// above line displays this... SELECT * FROM `Requests` WHERE idEmployees = 14 AND rDate = '2015-09-14'
$qMon = $pdo->prepare("SELECT * FROM `Requests` WHERE idEmployees = $id and rDate = '$rMon'"); // bombs out (I have tried putting double and single quotes around everything)