By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

How do I display Multiple images??

P: 49
I want to be able to display the same image a number of times, according to how is set by my database that drives the page.
I have database of top goal scorers, i know how to display a list of the top goal scorers from the database and how many goals they have scored, but against their name i want to repeat a football image the number of times they have scored and keep it dynamic to the database, is there any way of doing a repeating region but limted to the number thats in a field???? please help!
Oct 6 '06 #1
Share this Question
Share on Google+
4 Replies


P: 16
I don't get it?

So you're using PHP to call on fields from a databse, then display them in a table, why don't you add another cell in your DB and call it img then call on <img src=" <?PHP for pulling info from DB?>" /> for each table row...
Oct 7 '06 #2

ronverdonk
Expert 2.5K+
P: 4,258
You could make a table with 2 cells and put the photo in cell 1 and all the goals in cells 2 in (PHP) loop, as in the following example:
[PHP]<?php
// $goals = value extracted from database
?>
<table>
<tr><td><img src="photo.jpg"></td><td style="width:300px;">
<?php
for ($i=0; $i<$goals; $i++) {
echo '<img src="ball.gif">';
}
?>
'</td></tr>
[/PHP]

Ronald :cool:
Oct 7 '06 #3

P: 49
Thanks for your reply. i can see what your saying about doing a loop. 1'm a novis at this tho, i'm using an access database and asp. could do with a more detailed explanaition if you can!
Oct 12 '06 #4

P: 49
I don't get it?

So you're using PHP to call on fields from a databse, then display them in a table, why don't you add another cell in your DB and call it img then call on <img src=" <?PHP for pulling info from DB?>" /> for each table row...
I have a DB with the number of goals a player has scored, this will change each week, i want to display next to the number the same amount of footballs, i.e. if a player has scored 5 goals i want to display 5 footballs, if he then scores 2 more the next week, when i change the DB i want the images to reflect that and display 7 football images. So i just want a reapeating loop depending on the number in the DB
Please help!!!!
Oct 12 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.