运行此代码时,
<?php
if (isset($_POST['submitted'])){
include('Connect.php');
$category = $_POST['category'];
$criteria = $_POST['criteria'];
$query = "SELECT * FROM locations WHERE $category = '$criteria'";
$result = mysqli_query($dbcon, $query) or die('Error Recieving Data');
echo "<table>";
echo "<tr> <th>NAME</th> <th>ADDRESS</th> <th>LATITUDE</th> <th>LONGITUDE</th></tr>";
echo "</table>";
}
?>
“我的产品”最终是在echo "<table>"
部分之后,所有代码都显示在网站上,就好像它是html“ <p> </p>
”一样。我不确定是什么问题,因为这是我第一次使用php。