xwishmasterx Posted April 1, 2011 Share Posted April 1, 2011 As I title says; I need to have an image showed the number of times, the value of a table/field.. How can I do this? Link to comment https://forums.phpfreaks.com/topic/232424-adding-images-x-amount-of-times-depending-on-table-value/ Share on other sites More sharing options...
litebearer Posted April 1, 2011 Share Posted April 1, 2011 pusedo $x = value in table for($i=0;$i<$x;$i++) { ?> <IMG scr="image.jpg"> <?PHP } Link to comment https://forums.phpfreaks.com/topic/232424-adding-images-x-amount-of-times-depending-on-table-value/#findComment-1195591 Share on other sites More sharing options...
Pikachu2000 Posted April 1, 2011 Share Posted April 1, 2011 Or without a loop: echo str_repeat( '<img src="image.png">', $db_result ); Link to comment https://forums.phpfreaks.com/topic/232424-adding-images-x-amount-of-times-depending-on-table-value/#findComment-1195622 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.