I would like to insert masonry into a php form that retrieves images from a MySQL database. I can retrieve the images, but when I try to put in masonry, the whole thing doesn't work at all.
Here is my code
$result = mysqli_query($con,"SELECT * FROM img");
while($row = mysqli_fetch_array($result)) {
echo "<script src="/path/to/masonry.pkgd.min.js"></script>"
echo "<div id="container">"
echo "<img class='item' src='" . $row['path'] . "' />";
echo "</div>"
}
mysqli_close($con);
?>