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? Quote 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 } Quote 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 ); Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.