|
|
|
| Помогите найти ошибку, закомментирую, страница отображается, только заберу комменты, т.е., раскомментирую этих два блока, - страница не отображается:
<?php
if(isset($_GET["turn"]))
{
$id_opinion=$_GET["turn"];
$query_turn="select status from films_opinion where (id_opinion = ".$id_opinion.")";
$result_turn = mysql_query($query_turn);
$status_turn = mysql_fetch_assoc($result_turn);
switch($status_turn)
{
'on': $query_change="update films_opinion set status='off' where (id_opinion = ".$id_opinion.")";
mysql_query($query_change); break;
'off': $query_change="update films_opinion set status='on' where (id_opinion = ".$id_opinion.")";
mysql_query($query_change); break;
}
}
?>
|
и вот этот:
<?php if(isset($_GET["turnall"]))
{
$status_turnall=$_GET["turnall"];
switch($status_turnall)
{
'on': $query_change="update films_opinion set status='off'";
mysql_query($query_change); $turnall='off'; break;
'off': $query_change="update films_opinion set status='on'";
mysql_query($query_change); $turnall='on'; break;
}
}
else
{
$query_change="select status from films_opinion";
$result_change=mysql_query($query_change);
$on=0;
$off=0;
while($row_change=mysql_fetch_assoc($result_change))
{
if($row_change["status"] == 'off')$off++;
else $on++;
}
if($off > $on)
{
$status_turnall='off';
$turnall='on';
}
else
{
$status_turnall='on';
$turnall='off';
}
} ?>
|
| |
|
|
|
|
|
|
|
для: Dmitry Berkut
(23.10.2007 в 18:52)
| | Что??? Неужели синтаксически все правильно??? | |
|
|
|
|
|
|
|
для: Dmitry Berkut
(23.10.2007 в 18:52)
| | у вас отсутсвует оператор case в конструкции switch.
<?
switch($status_turn)
{
case 'on': $query_change="update films_opinion set status='off' where (id_opinion = ".$id_opinion.")";
mysql_query($query_change); break;
case 'off': $query_change="update films_opinion set status='on' where (id_opinion = ".$id_opinion.")";
mysql_query($query_change); break;
}
?>
|
| |
|
|
|
|
|
|
|
для: Drago
(23.10.2007 в 19:15)
| | Я сейчас ударил себя по голове. Я так и знал. ))))))) Какой кошмар, - заработался малость, все пора до-дому баю-баюшки!!! Спасибо огромное! | |
|
|
|