Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $query="SELECT * FROM classifica ORDER BY Voto DESC";
- $res=mysqli_query($con, $query);
- if($res && mysqli_num_rows($res)>0){
- while($row=mysqli_fetch_assoc($res)){
- $nome = $row['Nome']."";
- $data = $row['Data']."";
- $voto = $row['Voto']."";
- $link = $row['Link']."";
- setlocale( LC_TIME,"it_IT");
- $data2 = strftime('%d %B %Y', strtotime($data));
- $pos = 1;
- $controllo = substr($voto, -1, 1);
- $voto2 = str_replace(".0", "", $voto);
- ?>
- <tr>
- <td><?php echo $pos++; ?></td>
- <td><strong><?php echo $nome; ?></strong></td>
- <td><?php echo $data2; ?></td>
- <td><strong><?php if($controllo=="0"){echo $voto2;} else {echo $voto;} ?>/10</strong></td>
- <td><?php if(!$link){echo '-';} else { ?><a href="https://www.youtube.com/watch?v=<?php echo $link; ?>" target="_blank">LINK</a></td><?php } ?>
- </tr>
- <?php }
- } else { ?>
- <tr><td colspan="5">Errore!</td></tr>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement