我正在尝试使用 PHP 在 MySQL 中简单地显示一个视图,但我不断出错。关于 T_STRING 错误可能是什么的任何建议?谢谢。
解析错误:语法错误,第 14 行 /home/theaudit/public_html/_sandbox/index.php 中的意外 T_STRING
<?php
// connection parameters
$db_host="a";
$username="b";
$password="c";
$db_name="d";
// connection variables
$db_con=mysql_connect($db_host,$username,$password);
$connection_string=mysql_select_db($db_name);
// page variables
$query = SELECT * FROM a_aif_remaining;
$result = mysql_query($query);
// connection to mysql and db
mysql_connect($db_con) or die("Unable to connect to MySQL");
mysql_select_db($db_name) or die("Unable to select database");
// successful result
echo "<table border=1>
<tr>
<th>aif</th>
<th>fee_source</th>
<th>company_screename</th>
<th>filing_date</th>
<th>document_subtype</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['aif_id'] . "</td>";
echo "<td>" . $row['fee_source_id'] . "</td>";
echo "<td>" . $row['company_name_per_sedar'] . "</td>";
echo "<td>" . $row['document_filing_date'] . "</td>";
echo "<td>" . $row['document_subtype'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>