<?php
$db = mysqli_connect('localhost', 'root', '', 'medica');
$query = "SELECT nazwa, cecha FROM abonamenty JOIN szczegolyabonamentu ON abonamenty.id = Abonamenty_id JOIN cechy ON cechy.id = Cechy_id WHERE abonamenty.id = 1;";
$result = mysqli_query($db, $query);
while ($row = mysqli_fetch_assoc($result)) {
    echo $row['nazwa'] . " - " . $row['cecha'] . "<br>";
}
mysqli_close($db);