February 15th, 2013, 07:33 PM
Displaying Stars Without Voting
I'm new to Mysql and creating a simple project. I've created a table called musicCD and stored some data such as song name, artist and rating.
Here's what the code look like
CREATE TABLE musicCD(
INSERT INTO musicCD VALUES('Stan', 'Eminem', 4);
I've rated each song from 0 to 5, so when I do
SELECT Song, Artist, Rating
It'll print the song, artist, and the ratings as below
Song Artist Rating
Stan Eminem 4
How will I force this program to display 4 starts rather than number 4 or as many as the number of ratings?
Thanks for any help..
February 15th, 2013, 08:37 PM
presumably you meant 4 stars, not starts
Originally Posted by lampardd
, LEFT('*****',Rating) AS stars
February 15th, 2013, 08:56 PM
Yes, I meant stars. Thanks a lot for the help.
Originally Posted by r937