/// Функция для получения информации о видео, полная страница видео
function get_data($table,$title,$lang){
db_connect();
$query = sprintf("SELECT * FROM $table WHERE $table.title_url = '%s' AND $table.lang = '%s' ",
mysql_real_escape_string($title),
mysql_real_escape_string($lang));
$result = mysql_query($query);
$row = mysql_fetch_array($result);
return $row;
}
///Функция для Пред и След Видео
function select_one_video($title, $lang){
db_connect();
$query = "SELECT `video`.*, (SELECT count(c.`id`) FROM `comments` c WHERE c.`note_id` = `video`.`title_url` AND c.`lang` = '{$lang}') comments_count
FROM `video`
WHERE `video` .`id` > (SELECT v.`id` FROM `video` v WHERE v.`id` < {$title} ORDER BY v.`id` DESC LIMIT 1) AND `video`.`lang` = '{$lang}'
ORDER BY `video` .`id` ASC
LIMIT 3";
$result = mysql_query($query);
$result = db_result_to_array($result);
return $result;
}
Это файл video.php
Нужно написать условие if
<?php
$title = $_GET['t'];
if(!empty($title)){
$sel_one_video = select_one_video($title, $lang);
}
?>