Эй, сейчас я работаю над html / php страницей.
У меня есть файл заголовка, который я должен включить в свою страницу, но по какой-то причине он не работает, и я понятия не имею, я сделал то же самое для всех других моих страниц, и это сработало такЯ не знаю, почему вдруг это не работает.
<?php
include 'header.php';
?>
<center>
<p>
This page utilizes several postgreSQL method calls. Such as pg_connect(),
pg_query(), and pg_fetch_result().
</p>
<!-- setup the table -->
<table border="1" width="75%">
<tr><th width="50%">Make</th><th width="15%">Model</th><th width="20%">Year</th><th width="15%">MSRP</th></tr>
<?php
$output = ""; //Set up a variable to store the output of the loop
//connect
$conn = pg_connect("host=127.0.0.1 dbname=slotegraafd_db user=slotegraafd password=100658347" );
//issue the query
$sql = "SELECT automobiles.make, automobiles.model, automobiles.year, automobiles.msrp
FROM automobiles
ORDER BY automobiles.year ASC";
$result = pg_query($conn, $sql);
$records = pg_num_rows($result);
//generate the table
for($i = 0; $i < $records; $i++){ //loop through all of the retrieved records and add to the output variable
$output .= "\n\t<tr>\n\t\t<td>".pg_fetch_result($result, $i, "Make")."</td>";
$output .= "\n\t\t<td>".pg_fetch_result($result, $i, "Model")."</td>";
$output .= "\n\t\t<td>".pg_fetch_result($result, $i, "Year")."</td>";
$output .= "\n\t\t<td>".pg_fetch_result($result, $i, "msrp")."</td>\n\t</tr>";
}
echo $output; //display the output
?>
</table>
<!-- end the table -->
</center>
</body>
</html>
Это мой полный набор кода с оператором включения.Нет открывающего html или тега body, потому что он находится в заголовочном файле, поэтому я не должен добавлять его на этой странице.В любом случае, какая-нибудь помощь?
Спасибо.