SELECT
*
FROM
us_vd
INNER JOIN
user us ON us.user_id = us_vd.user_id
INNER JOIN
video v ON v.place_of_location = us_vd.video_id
WHERE
us_vd.user_id = 1
GROUP BY
us_vd.video_id
$sql_1 = "SELECT * FROM us_vd INNER JOIN user u ON u.user_id = us_vd.user_id INNER JOIN video v ON v.place_of_location = us_vd.video_id WHERE us_vd.user_id = :get ORDER BY us_vd.video_id DESC LIMIT 0,5";
$stq = $pdo->prepare($sql_1);
$stq->bindParam(':get', $_SESSION['user_id']);
$stq->execute();
$mov = $stq->fetchAll(PDO::FETCH_ASSOC);
include "../db/config.php";
if(empty($_SESSION)){
if(isset($_POST['submit'])){
$login = $_POST['login'];
$passwd = $_POST['passwd'];
$hash = hash('md5', $passwd);
$sql_2 = "SELECT user_id FROM user WHERE login=:login AND password=:passwd";
$stz = $pdo->prepare($sql_2);
$stz->bindParam(':login', $login);
$stz->bindParam(':passwd', $hash);
$stz->execute();
$found = $stz->fetchColumn();
if($found > 0 ){
$_SESSION['user_id'] = $found;
$_SESSION['user_name'] = $login;
}else{
$error .= "Логин или пароль неверны!";
}
header("Location: http://sitetop/inf/lk.php");
}
}
$sql_1 = "SELECT * FROM us_vd INNER JOIN user u ON u.user_id = us_vd.user_id INNER JOIN video v ON v.place_of_location = us_vd.video_id WHERE us_vd.user_id = :get ORDER BY us_vd.video_id DESC LIMIT 0,5";
$stq = $pdo->prepare($sql_1);
$stq->bindParam(':get', $_SESSION['user_id']);
$stq->execute();
$mov = $stq->fetchAll(PDO::FETCH_ASSOC);
<div class="uk-navbar-item uk-visible@l">
<ul class="uk-iconnav">
<div class="uk-inline">
<li><a href='../inf/lk.php' uk-icon='icon: sign-in' title='Личный кабинет'></a></li>
</div>
<?php if(empty($_SESSION)): ?>
<div class="uk-inline">
<li><a href='../inf/reg.php' uk-icon='icon: file-edit' title='Регистрация'></a></li>
</div>
<?php endif; ?>
<div class="uk-inline">
<li><a href='../inf/book.php' uk-icon='icon: bookmark' title='Закладки'></a></li>
</div>
<div class="uk-inline">
<?php
if($_SESSION['user_name'] = null || $_SESSION['user_id'] = null || !empty($_SESSION)): ?>
<li><a href='?logout=true' uk-icon='icon: sign-out' title='Выйти'></a></li>
<?php if($_GET['logout'] == 'true'){
unset($_SESSION);
session_destroy();
header("Location: http://sitetop/");
}
?>
<?php endif; ?>
</div>
</ul>
</div>
if($_GET['l'] == 'o'){
unset($_SESSION);
session_destroy();
}
SELECT us_vd.video_id, v.id FROM и так далее?
Т.е. использовать все те поля, которые в запросе?