|
|
|
|
|
для: Trianon
(09.06.2006 в 16:08)
| | ICQ 238-256-091 | |
|
|
|
|
|
|
|
для: sasch
(09.06.2006 в 15:58)
| |
Слегка ошибся:
// Смотрим сколько чего.
// Если NULL, просто выводим все относительно двух других параметров
if($status != '3' && mysql_num_rows($hot) == 0)
{
while($status != '3' && mysql_num_rows($hot) == 0 )
{
$status = $status - 1;
$tmp2 = " and status='$status'";
$query = "SELECT * FROM hotels
WHERE hide='show'".$tmp1.$tmp2.$tmp3."
ORDER BY status, distance";
$hot = mysql_query($query);
if(!$hot) puterror("ERROR !");
}
$status = - $status;
}
// Showing the message
|
| |
|
|
|
|
|
|
|
для: sasch
(09.06.2006 в 15:58)
| | Нет, это моя ошибка. Все работает. Спасибо. | |
|
|
|
|
|
|
|
для: Trianon
(09.06.2006 в 15:08)
| | При обращении к другим отелям - ошибка.
Parse error: parse error, unexpected T_ELSE in z:\home\localhost\www\hotels\searcher.php on line 29
|
| |
|
|
|
|
|
|
|
для: sasch
(09.06.2006 в 14:13)
| |
<?php
// include 'config.inc.php'; // соединяемся с базой
$status = '3'; $tmp1 = $tmp2 = $tmp3 = '';
if(isset($_POST['status']) && $_POST['status']!='0') $tmp2 = " and status='".($status=$_POST['status'])."'" ;
if(isset($_POST['city']) && $_POST['city']!='0') $tmp1 = " and city='".$_POST['city']."'";
if(isset($_POST['location']) && $_POST['location']!='0') $tmp3 = " and location='".$_POST['location']."'";
$query = "SELECT * FROM hotels
WHERE hide='show'
".$tmp1.$tmp2.$tmp3."
ORDER BY status, distance";
$hot = mysql_query($query);
if(!$hot) puterror("ERROR !");
// Смотрим сколько чего.
// Если NULL, просто выводим все относительно двух других параметров
while($status != '3' && mysql_num_rows($hot) == 0 )
{
$status = $status - 1;
$tmp2 = " and status='$status'";
$query = "SELECT * FROM hotels
WHERE hide='show'".$tmp1.$tmp2.$tmp3."
ORDER BY status, distance";
$hot = mysql_query($query);
if(!$hot) puterror("ERROR !");
$status = - $status;
}
// Showing the message
if(mysql_num_rows($hot) == 0)
{
echo("<div id=msg-error><img src=../images/icons/attantion.jpg width=18 height=16 />
<p>Sorry, but there are no ".$_POST['status']." star hotels in that area of ".$_POST['city'].".</p>
<ul><li>Please, check the list of hotels that we have selected for you according your request</li></ul>
</div>");
}
// Если больше одной - выводим список статей
else
{
if($status < 0)
{
$status = - $status;
echo "-------------- hotel status reduced to $status-stars -------";
}
while($hotels = mysql_fetch_array($hot))
{
// DO NOT EDIT BELOW !!!
// Setting a country
|
и далее по тексту | |
|
|
|
|
|
|
|
для: sasch
(09.06.2006 в 15:00)
| | Нашла 5.1. Качаю. | |
|
|
|
|
|
|
|
для: sasch
(09.06.2006 в 14:55)
| | Где новую аську можно скачать? И какая (#) новая, свежая? | |
|
|
|
|
|
|
|
для: sasch
(09.06.2006 в 14:35)
| | Я тут по форуму походила и нашла ссылку на статью про сессии, что вы предложили прочитать. Очень позновательно и для меня. Очень вожно понять для чего нужны сессии. Я ими пользуюсь не так. | |
|
|
|
|
|
|
|
для: Trianon
(09.06.2006 в 14:29)
| | Нет, аськи нет, но если надо поставлю. Какую лучше? | |
|
|
|
|
|
|
|
для: sasch
(09.06.2006 в 14:13)
| | Момент первый. В функции cvt явно две сорные строки - их надо удалить:
if(!is_integer(intval($y)))
return die($y) *false;
|
Момент второй. Нужно поставить строку перед строками
if(isset($_POST['status']) && $_POST['status']!='0') $tmp2 = " and status='".$_POST['status']."'";
if(isset($_POST['city']) && $_POST['city']!='0') $tmp1 = " and city='".$_POST['city']."'";
if(isset($_POST['location']) && $_POST['location']!='0') $tmp3 = " and location='".$_POST['location']."'";
|
Насчет отелей класса ниже - сейчас гляну.
Кстати, у Вас аська есть? А то, похоже, я один "заинтересованных лиц" остался. :) | |
|
|
|
|