out put %

Results 1 to 3 of 3

Thread: out put %

  1. #1
    Join Date
    Dec 1969

    Default out put %

    i have a page that pulls random images from a access db i have put 10 radio buttons below the pic to rate the pic when any user rate the pic the rating is store in my db in the coloum of rate 1 to rate 10 . now when what i want is to out put the % of every image that is rated by the users but when i try it only out puts the total votes of first image in the db - do anybody have aidea that how do i get total votes for all images that are voted.<BR><BR>suhailkaleem<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: out put %

    it would help to see the field names in the table, but,generically, <BR><BR>i guess you have two tables? one called PICTURE and one called RATING where the primary key of PICTURE is joined as FOREIGN KEY on RATING (well that&#039;s how i&#039;d do it)<BR>so, if you want to get the name of the picture and the sum of it&#039;s rating you would do the query summat like this:<BR><BR>SELECT PICTURE.pictureName, Sum(RATING.rating) AS totalRating<BR>FROM PICTURE <BR>INNER JOIN rating ON PICTURE.pictureID = RATING.pictureID<BR>GROUP BY PICTURE.pictureName<BR>ORDER BY Sum(RATING.rating)<BR>

  3. #3
    suhailkaleem@hotmail.com Guest

    Default RE: out put %

    no i have two coloum in the same table , the table name is user_info , and the rating coloum is rate 1 to rate 10 if the user rate rate1 to the image then the value of 1 is added to the rate 1 coloum and so on for rate 2 to rate i want to out put the total votes and % of votes for every image that is randomly rated . like when a user rates a pic then on next page it should see that images total votes and % of votes - i cam provide with the script that i made if u want it.<BR><BR><BR>suhailkaleem@hotmail.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts