I have the following query:
$query4 = $db->query("SELECT count(codes.lcfruh) AS front_lcfruh, kw, datum, GROUP_CONCAT(name) AS name FROM codes
RIGHT JOIN dienstplan ON (dienstplan.schicht = codes.lcfruh OR dienstplan.schicht = codes.lcteildienst OR dienstplan.schicht = codes.lcshteil)
RIGHT JOIN personal ON personal.perso_id = dienstplan.perso_id
WHERE personal.status_sum = 'rezeption' AND dienstplan.schicht!='' AND dienstplan.kw = '$kw' AND personal.zeigen='ja'
GROUP BY dienstplan.datum");
I want to have a result of 7 input fields (for every day of the week). That works correct. Both fields with the 0 or value greate than 0 are listed, actually input field are created.
while ($result = $query4 ->fetch_object()) {
echo '<p class="taglist1"><input name="" type="text" title="'.$result->name.'" class="zbroj'.$result->front_lcfruh.'" value="'.$result->front_lcfruh.'"></p>';
}
In the title I want to have names listed if they have certain value, that is working also UNTIL I put the following line in the code in the WHERE CLAUSE
AND (dienstplan.schicht = codes.lcfruh OR dienstplan.schicht = codes.lcteildienst OR dienstplan.schicht = codes.lcshteil)
The problem is the following in this case The result is not showing the fields that are not matching, where I should have the count(codes.lcfruh)=0
. The fields that are not matching are not shown.
Is there a chance that I can put this line elsewhere in the code in order to get the null fields listed also.