私は、実行したラウンドの数を含む実行の人を含むデータベースを作成しました。その後、私はHTMLチャートを作成するこのスクリプトを作成しました。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>';
?>
データベース:それはどのように見えるか http://img.prntscr.com/img?url=http://i.imgur.com/WklMcTG.png
スクリーンショット: http://img.prntscr.com/img?url=http://i.imgur.com/v2zbOSu.png
今、私は、ユーザーが自分の量のために人をソートする機能を提供したいです彼らが走ったラウンドのほとんどの人のように、最初の場所です。これどうやってするの?
あなたはdatatablesが欲しいのように聞こえます。 https://www.datatables.net/ –