Dezaktivator, Чем хорош php, всегда, все работает как надо![]()
Надо добавить индексы
ALTER TABLE `anekdot` ADD INDEX ( `type` ) ;
-- mod не стоит использовать в имени столбца
ALTER TABLE `anekdot` ADD INDEX ( `mod` ) ;a lot of hindu code
// example
case 'plus':
case 'minus':
if ($user_id) {
$res = mysql_fetch_assoc(mysql_query("SELECT refid, rating_users FROM `anekdot` WHERE `id` = '".$id."'"));
$user_rat = explode('|', $res['rating_users']);
if (!in_array($user_id, $user_rat)) {
$rating = 1; if ($act == 'minus') { $rating = -1; }
mysql_query("UPDATE `anekdot` SET `rating` = `rating`+".$rating.", `rating_users` = '".$user_id."|".$res['rating_users']."' WHERE `id` = '".$id."'");
die(header('Location: ?act=catalog&id='. $res['refid'] . $uri));
} else {
echo functions::display_error($lng_an['rating_error'], '<a href="?">'.$lng_an['title'].'</a>');
}
} else {
die(header('Location: ?'));
}
break;