<?php
if (isset($_GET['post_id'])) {
$nav = $_GET['post_id'];
$str = 1;
}
else {
$nav = 0;
}
$nav = intval($nav);
include_once 'functions.php';
include_once 'db.php';
$query = mysql_query("SELECT * FROM $table WHERE id = $nav") or exit(mysql_error());
while ($row = mysql_fetch_array($query)) {
// echo '<div class="post">';
echo '<h3> ' . $row["message"] . ' </h3>';
// echo '</div>';
}
?>
<?php
$postid = intval($_GET['post_id']);
include_once 'db.php';
$query = mysql_query("SELECT * FROM 'posts' WHERE id = $postid", $db) or exit(mysql_error());
$rows = mysql_fetch_array($query);
echo ' Пост: ' . $rows["message"] . 'ff';
?>
<?php
$postid = (int)$_GET['post_id']; // все это в файле single.php
include_once 'db.php'; // база данных (все верно)
$query = mysql_query("SELECT * FROM 'posts' WHERE id = $postid");
$rows = mysql_fetch_array($query);
echo ' Пост: ' . $rows["message"] . 'ff';
?>