Question: I fetched some div elements from database with this code :

```
 <?php
$getTickets = mysqli_query($db, "SELECT * FROM usersTicket");
while ($row = mysqli_fetch_array($getTickets)) {
    ?>
        <div class="tickets">
            <div class="ticket"><?php echo $row['ticketText'] ?></div>
        </div>
<?php
}
?>

```

How can I get the number of these `div` elements that fetched from database ?

Answer: 
Use this if you want to get the number of divs returned from the database.

```
 $number_of_divs = mysqli_num_rows($getTickets);

```
You could use jQuery for that:

```
$(document).ready(function() {
   var ticketclassnr = $(".tickets").length;
});

```