Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   PHP, PERL, MySQL, JavaScript (https://forum.antichat.xyz/forumdisplay.php?f=37)
-   -   что за ощибка??? (https://forum.antichat.xyz/showthread.php?t=138010)

selevit 28.08.2009 23:23

что за ощибка???
 
Всем доброго времени суток, я написал скрипт поиска для своего сайта, но при его запуске выходит ошибка:

Parse error: parse error, unexpected $end in p:\home\localhost\www\softolom_blog.com\search.php on line 135

вот сама страница со скриптом:

Код HTML:

<?php include ("blocks/bd.php");
if(isset($_POST['submit_s'])) {$submit_s = $_POST['submit_s'];}
if(isset($_POST['search'])) {$search = $_POST['search'];}


if(isset($submit_s))
{

if(empty($search) || strlen($search) < 4)
{
echo
"<html>
<head>

<meta http-equiv='Refresh' content='0; URL=index.php'>


</html>
</head>";

$search = trim($search);
$search = stripslashes($search);
$search = htmlspecialchars($search);

$result = mysql_query("SELECT id, title, desctiption, date, author, view, download FROM data WHERE MATCH(text) AGAINST('$search')",$db);

}



}

else
{
echo
"<html>
<head>

<meta http-equiv='Refresh' content='0; URL=index.php'>


</html>
</head>";
}



 
$result = mysql_query("SELECT title,meta_d,meta_k,text FROM settings WHERE page = 'index'", $db);


if(!$result) {
echo "<center><b><p>Запрос на выборку данных из базы не прошел, напишите об этом администратору на email: selevit@yandex.ru или в ICQ:375766234<br><strong>Код ошибки:
 <br></strong></p></b></center>";

exit(mysql_error());

}

if (mysql_num_rows($result) >
0)

{
$myrow = mysql_fetch_array($result);
}

else

{
echo "<strong><p><center>Инфотмация по запросу не может быть извлечена, так как в таблице БД нет записей</center></p></strong>";

exit();
}
?>




<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="main_border">

<?php include ("blocks/header.php");?>

  <tr>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="top" id="s">
      <tr>
        <?php include ("blocks/left_td.php");?>
        <td width="77%" align="left" valign="top">
       
       
        <p class="nav_title">Поиск</p>
       
     
                <?php
                if (mysql_num_rows($result) >
0)

{
$myrow = mysql_fetch_array($result);

do
{

printf ("    <table align='center' class='post'>
            <tr>
            <td>
                        <p class = 'nav_link'><a href='view_post.php?id=%s'>%s</a>
                        <p class = 'post_adds'>Дата Добавления: %s</p>
                        <p class = 'post_adds'>Добавил: %s</p>
                        </td>
            </tr>
                        <tr>
                        <p><td>%s
                        <p class = 'post_view'>Просмотров: %s</p>
                        <p class = 'post_view'>Загрузок: %s</p>
                        </tr>
            </table>", $myrow['id'], $myrow['title'], $myrow['date'], $myrow['author'], $myrow['description'], $myrow['view'], $myrow['download']);


}

while ($myrow = mysql_fetch_array($result));?>
 
       
        </td>
      </tr>
    </table></td>
  </tr>
<?php include ("blocks/footer.php");?>
</table>
</body>
</head>
</html>


eLWAux 28.08.2009 23:29

Код:

while ($myrow = mysql_fetch_array($result));}?>

gisTy 28.08.2009 23:32

просто ты забыл закрыть фигурную скобку
Код:

<?php
                if (mysql_num_rows($result) > 0)

{          <-------1 открыл
$myrow = mysql_fetch_array($result);

do
{ <-------2 открыл

printf ("    <table align='center' class='post'>
            <tr>
            <td>
                        <p class = 'nav_link'><a href='view_post.php?id=%s'>%s</a>
                        <p class = 'post_adds'>Дата Добавления: %s</p>
                        <p class = 'post_adds'>Добавил: %s</p>
                        </td>
            </tr>
                        <tr>
                        <p><td>%s
                        <p class = 'post_view'>Просмотров: %s</p>
                        <p class = 'post_view'>Загрузок: %s</p>
                        </tr>
            </table>", $myrow['id'], $myrow['title'], $myrow['date'], $myrow['author'], $myrow['description'], $myrow['view'], $myrow['download']);


} <-------2 закрыл

while ($myrow = mysql_fetch_array($result));?>
 
       
        </td>
      </tr>
    </table></td>
  </tr>
<?php include ("blocks/footer.php");?>
</table>
</body>
</head>
</html>

а один не закрыл

selevit 28.08.2009 23:33

Спасибо!!!

selevit 29.08.2009 00:07

Разобрался


Время: 16:37