Hi,
Ok, the error was because there was no '' around my sub query. This has now been changed to ;
$q3 = "SELECT prog_name, prog_code
FROM programmes
WHERE parent_prog = 'N/A'
AND prog_code
NOT IN ('SELECT prog_code FROM contactxprogrammes WHERE contact_code = 3001')
ORDER BY prog_name
";
$rslt3 = mysql_query($q3);
while($row3 = mysql_fetch_array($rslt3)){
echo "<p>";
echo "<input type=\"checkbox\" name=\"programmes[]\" value=\"".$row3['prog_code']."\">".$row3['prog_name']."";
echo "</p>";
}
However the query is not working as all entries are being pulled out of the first table , the sub query is being ignored.