Moderator |
|
Geneste queries worden pas recent ondersteund, dus het kan goed zijn dat je MySQL niet nieuw genoeg is (?). Je kan je query altijd in 2 delen opsplitsen:
<?php
$query = "SELECT DISTINCT JobID FROM jobX";
$res = mysql_query($query) or die(mysql_error());
$temp = array();
while($row = mysql_fetch_row($res)) {
$temp[] = $row[0];
}
mysql_free_result($res);
$ids = "(".implode(",", $temp).")";
$query = "SELECT job.ID FROM job WHERE job.ID NOT IN ".$ids;
$res = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_...($res)) {
...
}
?>
<?php $query = "SELECT DISTINCT JobID FROM jobX"; $temp[] = $row[0]; } $ids = "(".implode(",", $temp).")"; $query = "SELECT job.ID FROM job WHERE job.ID NOT IN ".$ids; while($row = mysql_fetch_...($res)) { ... } ?>
|