我正在努力縮小我正在玩的遊戲的搜索結果。從搜索結果中縮小搜索
我試圖通過單擊顯示的特定用戶來縮小我的搜索結果範圍。一旦用戶被點擊,它需要顯示該用戶的所有數據庫條目。
例如,
我質數據庫字段有: - 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>";
?>
任何幫助將是FANT astic。
*傳遞用戶ID爲get parm然後清理get param然後用user = get用戶查詢* – 2013-03-19 08:31:18
謝謝,但對此我很陌生,沒有編程背景,只是不明白爲什麼大聲笑。我很幸運能夠通過閱讀無數個論壇來獲得這麼多 – 2013-03-19 09:42:00