<tr> <th>Name</th> <th>Theme</th> <th>Price</th> <th>Description</th> <th></th> <th colspan="2"></th> </tr> </thead> <tbody> <?php // output data of each row while ($row = $user_events->fetch_assoc()) { require_once 'class.event.php'; $event = new Event($row["event_category_id"]); $event_field = $event->get_event(); $description = strlen($event_field["description"]) > 13 ? substr($event_field["description"], 0, 150) . '...' : $event_field["description"]; ?> <tr> <td><?php echo $event_field["name"]; ?> </td> <th>---</th> <td><?php echo $event_field["price"]; ?> $</td> <td><?php echo $description; ?>