检查数据库中是否存在$ _REQUEST url

I'm using $id = intval( $_REQUEST['id'] ); , to get ID of the news/posts on my website, and the link to the news is article.php?id=XXX. So when someone type ?id=1 and there's nothing it's empty, no posts, it should go to index page (index.php) instead showing blank page. Is it possible? I've tried via isset something but it didn't worked. Can anyone help me with this, please.

if($ArticleSQL = $mysqli->query("SELECT * FROM articles WHERE id='$id' ")){
...
}

You can check the number of results with $ArticleSQL->num_rows.

So your code will now be:

$ArticleSQL = $mysqli->query("SELECT * FROM articles WHERE id='$id' ");

if($ArticleSQL->num_rows > 0) {
    $article = $ArticleSQL->fetch_array();

    //show the article here

} else {

    //redirection:
    header("Location: index.php");
}

You need to check if the query found anything. Your code simply checks if the query succeeded. A query which returns no rows is NOT a failure. It's a perfectly valid result set that happens to have no rows in it.

$result = $mysqli->query(...);
if ($result->num_rows > 0) { ... found something ... }