Forum Moderators: coopster

Message Too Old, No Replies

Left Join not returning results

         

knighty

10:15 am on Sep 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




I have 2 tables one with details such as address etc. and the other with a review, the first table will always have details but the second one may or may not have a review.

I thought using LEFT JOIN would return the first table and the second one would just have NULL values. The query works fine if details and review is present but at the moment if the second table dosnt have a review I wont get any results.

$query="SELECT *,sum(onTime) as onTimeTotal, sum(qaulity) as qaulityTotal, sum(speed) as speedTotal, sum(price) as priceTotal FROM print_review LEFT JOIN printerDetails on (print_review.printRef=printerDetails.ref) where print_review.printRef='$printer' GROUP BY printRef"; }

Any ideas?

knighty

10:53 am on Sep 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorted it :)

just moved the order of the tables so details came first and then check details table for the variable