Fl0 42
Fl0 42

Reputation: 21

<br> does not work in my while

I come to you because I encounter a problem with my while loop.

I did a while loop to get the id of tickets and ticket titles.

Except that, I want to add a <br> but it does not work, it does not move.

I tried with two <br> <br> it's the same, can you help me please?

enter image description here

Here is my code :

<?php while ($row = $req_5->fetch()) { ?>
   <a href="ticket.php?id=<?php echo $row['id_ticket']; ?>"><?php echo $row['titre']."<br><br>"; ?></a>
<?php } ?>

Upvotes: 0

Views: 59

Answers (1)

pr1nc3
pr1nc3

Reputation: 8338

    <?php while ($row = $req_5->fetch()) { ?>
    <a href="ticket.php?id=<?php echo $row['id_ticket']; ?>"><?php echo $row['titre']?></a>
    <br><br>
<?php } ?

just put the break tag outside of the anchor element

Upvotes: 1

Related Questions