Friday, 9 August 2013

display number as image in sql

display number as image in sql

I'm designing a website for a neighbor for a potential restaurant he wants
to open. I need to create a page for testimonials/review. I'd like to code
it so that the number of stars is in a SQL, I'm just not sure how to do
it.
Essentially what I'm looking for is a way to determine the integer of the
ratings field (1-5) and for each number, display a star image.
So:
if rating = 1, display star.png once
if rating = 2, display star.png twice
...
if rating = 5, display star.png five times
I'm just not sure how to write the code to do so.
The website is being written in PHP and CSS. I'd like to avoid JQuery,
Javascript, .NET, and so forth, as I'm not as familiar with them and will
be the one keeping the site up to date.

No comments:

Post a Comment