Here's my query:
$query = 'SELECT b.author as author, b.review as review FROM location_final_similar a LEFT JOIN location_reviews b ON (a.uuid = b.uuid AND a.originalLocationID = b.originalLocationID) WHERE a.finalLocationID = "'.$locationID.'"';
As you can see above, my only concern is to get author and review (which is retrieved from table location_reviews).
When I tested with $locationID that has data inside location_reviews, mysqli_num_rows would return the right count.
But when I tested with $locationID that has no data inside location_reviews, mysqli_num_rows would still return 1, but with author & review null. So how can I avoid this? I need mysqli_num_rows to return 0 if there's no review for the given ID.