How to show all DB result in PDO-form? : So,
I just started with PDO and the connection and stuff work great, but now I have a little problem. I'm stuck on a part where I want to show 6 results per table. My code is as following:

                                    <?php
                                $sql = "SELECT * FROM db WHERE id BETWEEN 1 AND 6";
                                $stmt->bindParam(':userName', $userName);
                                $stmt->bindParam(':hours', $hours);
                                try {
                                    $stmt = $conn->prepare($sql);
                                    $result = $stmt->execute($parameters);
                                } while($row = $result->fetch_assoc()){ ?>
                                    <tr>
                                        <td><b><?php echo $row['hours'] ?></b></td>
                                        <td><a href="#"></a></td>
                                        <td id="dayhour-1">
                                            <input placeholder="Name" type="text" class="form-control" id="1" value="<?php echo $row['userName'] ?>">
                                        </td>
                                    </tr>
                                <?php  } $stmt->close(); ?>
When I go to the webpage, it is showing the well-known 500 error. I have no idea what I am doing wrong because I am a starter. Please let me know what I am doing wrong and how I can solve this problem.