prepare("SELECT * FROM filmide_ajad WHERE marksona IS NOT NULL AND marksona LIKE ? GROUP BY marksona"); $sql->bind_param("s",$search_param); $sql->execute(); $result = $sql->get_result(); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $marksonaResult[] = $row["marksona"]; } echo json_encode($marksonaResult); } $conn->close(); ?>