echo "Товары на продаже: <select name='myproducts'>";
$myproducts = $link->prepare("SELECT * FROM `products` WHERE `author` = ?");
$myproducts->execute([$_SESSION['login']]);
$row = $myproducts->fetchAll(PDO::FETCH_ASSOC);
echo "<option name='".$row['id']."' value='".$row['name_p']."'>".$row['name_p']."</option>";
echo "</select> <br>";
echo $row['id'];