Results 1 to 3 of 3

Thread:

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    mKrotiFy's Avatar
    Join Date: Oct:2010
    Location: , 💪
    Posts: 1,062

    php .. . , , . , .
    PHP Code:
                $results mysql_query("SELECT `answer`,`votes` FROM `polls_answers` WHERE question_id = '".$row['id']."'") or die (mysql_error());
                echo 

                    <div class="pollquestion">'
    .$row['question'].'</div>
                '
    ;
                while(
    $raq mysql_fetch_assoc($results)){
                
    $nums mysql_num_rows($results);
                
    $percent floor(($nums/$raq['votes'])*100);
                    echo 
                        
    $raq['answer'].' - '.$raq['votes'].' - '.$percent.'%<br />
                    '
    ;
                } 
    , 2 10 - 20%, 4 - 50%, 100, 10 - 4.

  2. #2
    Defender Kaspirtov's Avatar
    Join Date: Jun:2006
    Location: Sf
    Posts: 7,414
    20% 10 (), 50

    () 4 8, 50%

    100. , -:
    $percent = floor(($nums/$raq['votes'])*100);
    , ;
    nums, 10 4 , $raq['votes'] 14 (.. )

    :
    ( php, ) $nums = mysql_num_rows($results); ?

    $raq = mysql_fetch_assoc($results) ?

    2: Sql :
    $results = mysql_query("SELECT `answer`,`votes` FROM `polls_answers` WHERE question_id = '".$row['id']."'") or die (mysql_error());
    ; , % ( 2 102)

    3: floor . 23.98 24% floor 23 . 1- 100 -. : 2 14 20 50
    " , , , , ."

  3. #3
    mKrotiFy's Avatar
    Join Date: Oct:2010
    Location: , 💪
    Posts: 1,062
    nums, 10 4 , $raq['votes'] 14 (.. )
    !

Posting Permissions

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

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |