I am trying to get id from url "/view.php?postID=2", having this code:
$post = "SELECT * FROM news WHERE postID='$postID'";
$post1 = mysql_query($post);
$postV = mysql_fetch_array($post1);
$postID = $postV['postID'];
$postImg = $postV['img'];
$postTitle = $postV['title'];
$postAuthor = $postV['author'];
$postDate = $postV['date'];
$postCategory = $postV['category'];
$postText = $postV['text'];
<?php
if (isset($_GET['postID'])) {
$newsID = $_GET['postID'];
}
echo "<section class='view_news'>
<img class='view_newsimg' src='$postImg'>
<h3 class='lath'>$postTitle</h3>
<ul class='det'>
<li class='adc'>avtori: $postAuthor</li>
<li class='adc'>TariRi: $postDate</li>
<li class='adc'>kategoria: $postCategory</li>
</ul>
<p class='news'>
$postText
</p>
</section>";
?>
but it only shows data from the array where postID = 1
can anybody tell me what to do? Thanks :)