I am using php/mysql, and have a database table with image url. I would like to know how can I put them on a php page with a 3 x 3 table, such that each td will show a different image based on the image url from the database?
I want to create something like this, where the alphabets are the images:
|a|b|c|
|d|e|f|
|g|h|i|
So far, I am only able to use do while to create something like this:
|a| | |
|b| | |
|c| | |
Thanks.
This would be the general approach:
That is, just loop the results normally but on every third item, echo a row change (
</tr><tr>). Just make sure that you don’t print extra row changes at the beginning or the end, hence the additional conditions.The resulting table should be something like this (line breaks added):