- Messages
- 5,093
- Reaction score
- 2,881
- Points
- 1,103
Hello,
I need agian your help . I have created a database which contains people from a run with the ammount of rounds which they ran. After that I created this script (with some google work ) which create a html chart.
The script:
The Database:
Screenshot how it looks:
Now I want to give the users the ability to sort the people for their ammoun of rounds which they ran. Like the most person is at the first place. How can I do this?
Regards,
CabCon.
I need agian your help . I have created a database which contains people from a run with the ammount of rounds which they ran. After that I created this script (with some google work ) which create a html chart.
The script:
PHP:
<?php
$db = new PDO("mysql:host=HIDDEN;dbname=HIDDEN", 'HIDDEN', 'HIDDEN') or die ("Verbindung nicht möglich");
$query_temp = $db->prepare("SELECT * FROM runners");
$query_temp->bindParam(':id', $id);
$id = 1;
$query_temp->execute();
echo '<table class="table table-hover">';
echo '<tr>';
echo '<th>ID</th>';
echo '<th>Name</th>';
echo '<th>Runden</th>';
echo '</tr>';
while($id_table = $query_temp->fetch(PDO::FETCH_ASSOC)) {
echo '<tr>';
echo '<td>'.$id_table['runner_id'].'</td>';
echo '<td>'.$id_table['runner_name'].'</td>';
echo '<td>'.$id_table['runner_rounds'].'</td>';
echo '</tr>';
}
echo '</table>';
?>
The Database:
Screenshot how it looks:
Now I want to give the users the ability to sort the people for their ammoun of rounds which they ran. Like the most person is at the first place. How can I do this?
Regards,
CabCon.