Things for you to do:
Fix code - spaces are important:
value="<?php echo$row['genre'];?> >
value="<?php echo $row['genre']; ?>"
But really, loops that build HTML should, in general, build the HTML and not just the values (from the php). Your foreach() statement should not end the php abruptly but instead build the entire HTML, like this:
foreach ($result as $row) {
ECHO "<div class="list-group-item checkbox">"
. " <label><input type='checkbox' class='common_selector genre'"
. " value=\"{$row['genre']}\"> {$row['genre']} </label>"
. "</div>";
}
This is much more readable and puts out your rows of data. This