あなたが気づくことができる問題はありますか?これまでのテストでは、クエリを実行するたびに HTTP 500 が返されました。
<?php
require_once "dbConnect.php";
require "../www/showArticle.php";
$queryBodyCommand = "SELECT pbody FROM pages WHERE id='$pageid' LIMIT 1";
$queryBody = mysql_query($sqlConnect, $queryBodyCommand) or die (mysql_error());
while ($row = mysql_fetch_array($queryBody)) {
$body = $row["pbody"];
$title = $row["title"];
}
mysql_free_result($queryBody);
$queryLabelCommand = "SELECT id, label FROM pages WHERE showLabel ='1' AND enabled ='1' ORDER BY id ASC";
$queryLabel = mysql_query($sqlConnect, $queryLabelCommand) or die (mysql_error());
while ($row = mysql_fetch_array($queryLabel)) {
$pid = $row["id"];
$label = $row["label"];
$menuList = '<a href="index.php?pid=' . $pid . '">' . $label . '</a><br />';
}
mysql_free_result($queryBody);
?>
これは私のshowArticle.phpです:
<?php
require_once('../sub/dbConnect.php');
require('../sub/functions.php');
if (!$_GET['pid']) {
$pageid = '1';
} else {
$pageid = ereg_replace("[^0-9]", "", $_GET['pid']);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title; ?></title>
</head>
<body>
<?php echo $title; ?>
Body:
<?php echo $body; ?>
</body>
</html>