Display certain picture according to database
Posted: Mon Jan 23, 2006 1:41 am
Hello,
I have a working database that is used for a voting system. There is one table with two fields, one field is the answer field and the other field is number_of_votes. I want to make a script that displays a picture according to the answer with the most votes.
So for example
if 2 has the most votes = displays 2.jpg
if 3 has the most votes = displays 3.jpg
if 4 has the most votes = displays 4.jpg
...
The form is pretty simple:
That form and the database work fine.
The only thing I need help with doing is displaying the picture according to the answer with most votes.
Get what I mean?
Thank You!
I made the database with the help of jshpro2
I have a working database that is used for a voting system. There is one table with two fields, one field is the answer field and the other field is number_of_votes. I want to make a script that displays a picture according to the answer with the most votes.
So for example
if 2 has the most votes = displays 2.jpg
if 3 has the most votes = displays 3.jpg
if 4 has the most votes = displays 4.jpg
...
The form is pretty simple:
Code: Select all
<form action="/pages/vote.php" method=post>
<option value ="1">1</option>
<option value ="2">2</option>
<option value ="3">3</option>
<option value ="4">4</option>
<option value ="5">5</option>
</select>
<input type=button value="Vote!">The only thing I need help with doing is displaying the picture according to the answer with most votes.
Get what I mean?
Thank You!
I made the database with the help of jshpro2