"Информация по запросу не может быть извлеченна в таблице нет записей"
Судя по "извлеченна" это сообщение выводится вашим скриптом, а не является стандартной ошибкой.
Видимо проблема в формировании запроса.
Предлагаю - запрос по выводу - в студию
Да, это сообщение выводиться моим скриптом, а вот код самой страницы котороя должна выводить сам пост:
<?php
include ("blocks/bd.php");/* соедение с базой */
if (isset($_GET['id'])) {$cat = $_GET['id'];}
if (!isset ($id)) {$id =1;}
/* Проверяем, является ли переменная числом */
if (!preg_match("|^[\d]+$|", $id)) {
exit ("<p>Неверный формат запроса! Проверьте URL!");
}
$result = mysql_query ("SELECT * FROM data WHERE id='$id' ",$db);
if (!$result)
{
echo"<p>Запрос на выборку данных из базы не прошел. Сообщите администратору<br> <strong>Код ошибки:</strong></p>";
exit(mysql_error());
}
if(mysql_num_rows($result) >0)
{
$myrow = mysql_fetch_array ($result);
/*счетчик просмотра страниц*/
$new_view =$myrow["view"] + 1;
$update = mysql_query ("UPDATE data SET view='$new_view' WHERE id='$id'",$db);
}
else
{
echo "<p>Информация по запросу не может быть извлеченна в таблице нет записей</p>";
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta name="description" content=" <?php echo $myrow["meta_d"];?>" />
<meta name="keywords" content=" <?php echo $myrow["meta_k"];?>" />
<style type="text/css"></style>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title> <?php echo $myrow["title"];?></title>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style2 {
color: #000033;
font-weight: bold;
}
.style3 {color: #000033}
.style4 {color: #CCCCCC}
-->
</style>
<body>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0" class="main_border">
<tr>
<td align="center" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="10">
<?php include ("blocks/header.php");?>
<tr>
<?php include("blocks/navigation.php");?>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr>
<td width="180px" align="left" valign="top"><table width="100%" border="0" cellpadding="5" cellspacing="0" class="left">
<?php include ("blocks/links_menu.php");?>
</table></td>
<td width="82%" align="left" valign="top" >
<?php printf ("
<table width='800px' border='0' align='center' cellpadding='5' cellspacing='0' class='tborder'>
<tr align='left' class='tcat'>
<td width='500px'>%s</td>
<td width='200px'></td>
<td >Дата:%s</td>
</tr>
<tr>
<td colspan='3'>%s</td>
</tr>
<tr align='left' class='weiter2'>
<td width='500px'>Автор:%s</td>
<td width='200px'></td>
<td >Просмотров: %s</td>
</tr>
</table> ",$myrow["title"],$myrow["date"],$myrow["text"],$myrow["author"],$myrow["view"]);
echo "<p><h4 class='style2'>Комментарии к заметке:</h4></p>";
$result3 = mysql_query ("SELECT * FROM comments WHERE post='$id'",$db);
if(mysql_num_rows($result3)>0)
{
$myrow3 = mysql_fetch_array($result3);
do
{
printf ("<table width='800px' border='0' cellpadding='10' cellspacing='0' class='weiter'>
<tr>
<td>
<p>Комментарий добовил(а): <strong>%s</strong> <br> Дата: %s</p> <p><em> %s </em></p>
</td>
</tr>
</table><br>",
$myrow3["author"], $myrow3["date"],$myrow3["text"]);
}
while ($myrow3 = mysql_fetch_array($result3));
}
$result4 = mysql_query ("SELECT img FROM comments_setting",$db);
$myrow4 = mysql_fetch_array($result4);
?>
<p class="style2">Добавить ваш комментарий :</p>
<table width='800px' border='0' cellpadding='10' cellspacing='0' class='weiter'>
<tr>
<td>
<form action="comment.php" method="post" name="form_com">
<p><label><span class="style4">Ваше имя: </span><br>
</label>
<input name="author" type="text" size="30" maxlength="40" /></p>
<p>
<span class="style3">
<label><span class="style4">Текст комментария:</span> </label>
</span>
<label><br>
<textarea name="text" cols="40" rows="4"></textarea></p>
</label>
<p class="style4">Введите сумму с картинки</p>
<p><img style='margin-top:20px;' src="<?php echo $myrow4["img"];?>" width="40" height="25" />
<input name="pr" type="text" size="5" maxlength="5" /></p>
<input name="id" type="hidden" value="<?php echo $id;?>" >
<p><input name="sub_com" type="submit" value="Добавить комментарий" ></p>
</form>
</td>
</tr>
</table><br></td>
</tr>
</table></td>
</tr>
<!--подключаеться нижний блок-->
<?php include ("blocks/footer.php");?>
</table>
</body>
</html>