您可以使用$_GET
mysite.com/index.php?PID=00001
获取PID的值
$pid = $_GET['PID'];
现在你在变量 $pid 中有 PID 的值并清理它
$pid = mysql_escape_string($pid);
现在使用这样的查询
$query = "SELECT * FROM your_table WHERE pid = $pid";
执行查询并在您的页面中显示结果
对不起。我不能为你写完整的代码。只是一个样本。
<?php
if (isset($_GET['PID'])) {
// Getting & cleaning value from url
$pid = mysql_escape_string($_GET['PID']);
// connection to your mysql
$con = mysql_connect("localhost", "your_username", "your_password");
$db = mysql_select_db("your_database", $con);
// Getting data from table
$query = "SELECT * FROM your_table WHERE pid = $pid";
$result = mysql_query($query);
// Checking weather we have results from table
if (!empty($result)) {
while ($row = mysql_fetch_array($result)) {
print_r($row);
// do operations with your data
}
} else {
echo 'no results';
}
} else {
echo 'no pid';
}
?>