I want to read 5 attributes of the database. The 5 attributes have the names post_image_1, post_image_2, post_image_3, post_image_4 and post_image_5. Now I want to show the 5 images on my page, with a for loop.
Here is the loop:
for($i = 1; $i <= 5; $i++){
echo "<img src='image/$row[post_image_$i].png' height='250px' width='250px'>";
}
Now I get an error:
Parse error: syntax error, unexpected '$i' (T_VARIABLE), expecting ']' in
I hope that's enough info to help me. :P