I need to loop through each result from the mysql table and generate html div for each row. The database table looks like below:
--------------------------------
id | color | width | img
--------------------------------
1 | red | 550 | url
--------------------------------
2 | black | 650 | url
--------------------------------
I have an opinion of how this might work but not sure about the syntax.
Following is my attempt.
<?php
$rows =
foreach ($rows) {
<div style="background-color:$color;width:$width;">
<img src="$img">
</div>
}