我有两个文件register.php, query.php
。我想要来自register.php
页面的功能我可以显示特定ID的数据,该数据在query.php
处理。
register.php
echo file_get_contents('query.php?id=1');
echo file_get_contents('query.php?id=2');
.
.
echo file_get_contents('query.php?id=14');
echo file_get_contents('query.php?id=15');
query.php
if (isset($_GET['id'])) {
$id = $_GET['id'];
switch ($id) {
case 1:
$query1 = mysql_query("select * from tblname where id=$id");
while ($row1 = mysql_fetch_array($query1)) {
$file = $row1['type'];
$file_type_name = "qsg";
$header = $row1['title'];
$paragraph_description = $row1['description'];
include '../../../print.php';
}
// break;
case 2:
$query1 = mysql_query("select * from tblname where id=$id");
while ($row1 = mysql_fetch_array($query1)) {
$file_type = $row1['type'];
$file_name = "email_intro";
$header = $row1['title'];
$abstract = $row1['description'];
include '../../../email.php';
}
// break;
// default:
// echo "other";
}
}
我必须显示数据库中所有id的数据。我不知道如何获取可能不同的特定id的数据,并在register.php页面上显示。
有人能帮帮我吗?