php - mysql_fetch_array is including previous value in next one -


I used this same code before, and not only for an image to show this IGG at a time ($ Query = mysql_fetch_array ($ tableone)) {$ Rating = $ query ['Rating'], but now the first value is the stars in right, this next one

  $ TotalV = $ query ['total_votes']; $ Commentcount = $ query ['comment_counts']; if (! $ Rating == 0) {$ number = $ rating / $ totalV; $ Number = (round ($ number, 3)); ($ x = 1; $ x & lt; = $ numbers; $ x ++) {$ star = '& lt; img src = "i Mg / stars.gif "width =" 14% "/> gt; ';} $ left = 5 - $ numbers; ($ x = 1; $ x & lt; = $ left; $ x ++) {$ result = '& Lt; img src = "img / whitestar.gif" width = "12%" /> & gt;';} if (strpoint ($ left, '.') == true) {$ hs. '& Lt; img src = "img / halfwhitestar.gif" width = "12%" />';} $ Result1 = $ star $ HS $ result;} and {$ result1 = 'tap';} if (Empty ($ total V)) {$ total V = 'no vote'; } $ TotalV = "/". $ TotalV; $ Ratingbox = "& lt; span id = \" ratingimg \ "& gt; $ Result1 "from  

My values ​​in the database of each image are

Ratings and total votes in the database

and this code looks like this

 rating is using this code in the entire image alongside the previous values ​​as well as the next

that I now use the table for all the images present in the database with all my information I am ... need guidance ... s

Since you are stacking the string during your loop, the strings of those people are only growing with each trip from the loop.

I recommend that you assign these variables to the empty string on each of your while loop: $ star , $ hs $ result

like this:

  = $ hs = $ result = ''; ...    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -