有?postid = $ value来查看某个MySQL Row

First of all, please excuse my noobish question. I'm building a blog platform and it all goes well, but I am totally unfamiliar with the $_GET method of PHP.

What I want to do is to have something like: when one goes to http://link.dom/blog.php?postid = 1 for example, the page should SELECT * FROM blog_posts WHERE id = 1.

Please note I don't ask for any code, but about what I have to do to achieve what I want.

Thank you in advance!

The variable value should be in $_GET['postid'] on blog.php You should be able to use that item in the $_GET array in any way you desire. For instance, you could place it in a variable -

$postID = $_GET['postid']; // assigns the array value to a variable

In Addition to Jay's Answer:

'SELECT * FROM blog_posts WHERE id = ' . (int)$_GET['postid']; 

Note the (int). It is casting the postid to an integer, to ensure, it is not an injection.

Depending on your Error Level you should prepend following:

if (!isset ($_GET['postid']) || !is_number($_GET['postid'])) {
    die('Error!');
}