プレイしているゲームの検索結果を絞り込もうとしています。
表示されている特定のユーザーをクリックして、検索結果を絞り込もうとしています。ユーザーがクリックされると、そのユーザーのすべてのデータベース エントリを表示する必要があります。
例えば。
私のデータベースフィールドは次のとおりです:-Alliance, User, Might
「同盟」を検索すると、現在、その同盟のすべてのユーザーのリストが表示されます
次に、特定の「ユーザー」をクリックして、そのユーザーの結果のみを表示したい
これは私がこれまでに持っているものです
<?php
mysql_connect ("localhost","my username","password") or die (mysql_error());
mysql_select_db ("my_dbase");
$term = $_POST['term'];
$data = mysql_query("select * FROM my_table WHERE alliance like '%$term%' ORDER BY type, alliance, might DESC");
echo "<table border='1' cellpadding='5'>";
echo "<tr> <th>Alliance</th> <th>User</th> <th>Might</th> </tr>";
// loop through results of database query, displaying them in the table
while($row = mysql_fetch_array( $data )) {
// echo out the contents of each row into a table
echo "<tr>";
echo '<td>' . $row['alliance'] . '</td>';
echo '<td>' . $row['user'] . '</td>';
echo '<td>' . $row['might'] . '</td>';
echo "</tr>";
}
// close table>
echo "</table>";
?>
どんな助けでも素晴らしいでしょう。