Im not sure if it´s possible to combine SELECT COUNT + Left Join on this way but it would be very helpful for me.
This is my code whitout Left Join attempt:
$pp = mysql_result(mysql_query("SELECT COUNT(*) FROM app_tgp WHERE idt='$zaznam[id]' AND ( partic='' OR partic='y' OR (partic=='n' AND $zaznam[logoff]=='n'))"), 0);
I have to get COUNT of players from the specific training (WHERE idt) where partic = '' OR partic = 'y' OR (partic = 'n' AND TRAINING[logoff] = 'n')
Problem is that TRAINING[logoff]
is value from different table. Am I able to make Left Join to get this value into Select Count to Where clause based on app_tgp.idt = app_training.id
?
Thanks for any answer!
The problem is here $zaznam[logoff]=='n'. There must be any column name where you have written $zaznam[logoff]. For Applying Left Join you should do something like this: