I’m testing this code
$query = "SELECT * from `items` where category_id=?";
$stmt = $mysqli->query($query);
$stmt->bind_param("s", $category_id);
$stmt->execute();
$result = $stmt->get_result();
while ($row = $stmt->fetch_assoc()) {
printf ("%s (%s)\n", $row['name'], $row['code']);
}
Is there any easier way to output whole table to HTML markup?
The following code snippet can match your requirements..but i’m not sure whether this is easier way or not..Hope this will help.
For the php,
For the js,