Mysqli表加入

I have a news table and want to link it to the members table to get the author information using Left Join, but I can't get the information to show from my php statement. Here is my php code:

Members Table: id, type, username, name, avatar

News Table: id, type, title, article, poster

<?php
CODE FOR PAGINATION
?>
<?php
if($usertype == "pub"){
    $get_articles_sql = "SELECT news.*, members.avatar, members.type AS membertype, members.name FROM news LEFT JOIN members ON members.id = news.poster LIMIT $offset, $post_limit";
}
else if($filter == "false"){
    $get_articles_sql = "SELECT news.*, members.avatar, members.type AS membertype, members.name FROM news LEFT JOIN members ON members.id = news.poster WHERE 3959 * acos( Cos( RADIANS(lat) ) * Cos( RADIANS('$yourlat') ) * Cos( RADIANS('$yourlon') - RADIANS(lon) ) + Sin( RADIANS(lat) ) * Sin( RADIANS('$yourlat'))) <= $yourradius ORDER BY news.date DESC LIMIT $offset, $post_limit";
}
else{
    $get_articles_sql = "SELECT news.*, members.avatar, members.type AS membertype, members.name FROM news LEFT JOIN members ON members.id = news.poster WHERE 3959 * acos( Cos( RADIANS(lat) ) * Cos( RADIANS('$yourlat') ) * Cos( RADIANS('$yourlon') - RADIANS(lon) ) + Sin( RADIANS(lat) ) * Sin( RADIANS('$yourlat'))) <= $yourradius AND type = '$filter' LIMIT $offset, $post_limit";
}
$get_articles_res = mysqli_query($con, $get_articles_sql);
if($get_articles_res){
    $num_articles = mysqli_num_rows($get_articles_res);
}else{
    $num_articles = "0";
}
?>
<?php
if($num_articles > 0){
while($article = mysqli_fetch_assoc($get_articles_res)){
    $article_id = $article["id"];
    $article_type = $article["type"];
    $article_title = $article["title"];
    $article_article = $article["article"];
    $article_city = $article["city"];
    $article_town = $article["county"];
    $article_date = $article["date"];
    $article_avatar = $article["avatar"];
    $article_name = $article["name"];
    $article_membertype = $article["membertype"];

    $show_article .= "

        <div class=\"section\">
            <div class=\"sectionInner\">
                <div class=\"searchAvatar\"><img class=\"searchAvatarSize\" src=\"uploads/avatars/$article_avatar\"></div>
                <div class=\"searchInformationLeft\"><div class=\"searchInformationPrimary\">$article_title</div><div class=\"searchInformationSecondary\"><i>&quot;$article_article&quot;</i></div></div>
                <div class=\"searchInformationRight\"><div class=\"searchInformationPrimary\">By $article_name</div><div class=\"searchInformationSecondary\">$article_membertype, $article_city</div><div class=\"searchInformationThird\"><a href=\"event.php?id=$event_id&url=".urlencode($url)."\">View Details</a></div></div>
                <div class=\"clearLeft\"></div>
            </div>
        </div>
        <div class=\"searchResultSplitter\"></div>

    ";
}
}else{...}
?>

I've tried this using just "SELECT * FROM new WHERE..." and it works fine so there must be something wrong in the join. Any ideas?

The problem with the 2nd and 3rd queries is that you are trying to use the columns lat and lon in the calculation, but you do not have columns called that in either the news table or the members table.