0
我有一個動態表,我想單擊鏈接示例位置A並轉到另一個php頁面。 然而,在另一個php頁面中,我想從位置A中選擇一些細節。我可以知道如何獲取值?我嘗試了一些方法,但仍然失敗。如何獲取用戶從動態表中選擇的值?
創建動態表:
<?php
include "mysqli.connect.php";
// Make a MySQL Connection
$_session['place'] = $row['links'];
$retrieveLocation = "SELECT COUNT(c.userid) AS userid, p.places, p.address, p.telephone, p.links FROM promotion AS p LEFT JOIN candy AS c on p.places = c.places GROUP BY p.places ORDER BY userid desc";
$result = $mysqli->query($retrieveLocation);
while ($row = $result->fetch_array(MYSQLI_ASSOC))
{
echo "<tr><td>{$row['places']}</td><td>{$row['address']}</td><td>{$row['telephone']}</td><td>{$row['userid']}</td><td><a href=\"".$row['links']."\">View</a></td></tr>";
}
?>
因此,這將產生從數據庫和輸出表中的值:
places | address | telephone | userid | links
----------------------------------------------
A | A.php
B | B.php
C | C.php
D | D.php
a.php只會
<?php
include "mysqli.connect.php";
// Make a MySQL Connection
$retrieve = "SELECT username, product, rating FROM ratings WHERE places='".$_SESSION['place']."'";
$result = $mysqli->query($retrieve);
while ($row = $result->fetch_array(MYSQLI_ASSOC))
{
echo "<tr><td>{$row['product']}</td><td>{$row['rating']}</td><td>{$row['username']}</td></tr>";
}
?>
所以對於我的最後列,當用戶點擊時,它將引導他們到頁面(例如A.php)。進入A.php頁面,我需要從位置A中選擇一些細節並顯示出來。 請幫忙嗎?謝謝。 (我剛剛嘗試的會話部分,它沒有工作)