I’m trying to write a very basic PHP script to fetch some information from a database and output it into a table. Here is the code I have written to far:
<html>
<head>
<title>FamInfo from dbCAN</title>
<meta name="description" content="Test PHP page">
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
</head>
<body>
<h1>FamInfo from dbCAN</h1>
<table align="center" border="1" cellpadding="5">
<th>Family ID</th><th>Signature Domain</th><th>class</th><th>note</th><th>activity</th>
<?php
include '/vars.php'; // fixed, no change
$conn = mysql_connect($hostname,$username,$password);
$db_selected = mysql_select_db($db,$conn);
$result = mysql_query("select * from FamInfo",$conn);
while ($row = mysql_fetch_array($result))
{
echo '<tr>'; // terminates here, at the second quote
echo "<td>" . $row["FamID"] . "</td>";
echo "<td>" . $row["SigDomain"] . "</td>";
echo "<td>" . $row["class"] . "</td>";
echo "<td>" . $row["note"] . "</td>";
echo "<td>" . $row["activity"] . "</td>";
echo '</tr><br>';
}
mysql_close($conn);
?>
</table>
</body>
For some reason, it seems as if the PHP is terminating at the line where I try to echo the table row, which means I’m not getting and of the values I need. Here’s an image of what the output looks like: 
Does anyone know why this is happening, or what a potential solution is? Thank you for your input!
You are not ending the
include '/vars.php'statement with a semi-colon. You should also enclose the header row in row tags,<tr></tr>.Also no need to have
<br>tag between table rows.You might have an error in
/vars.phpas well. Have you checked the error logs? You might post that code too.