所以我已经看了一个小时了,我不知道为什么它会抛出500错误。这将是非常明显的东西,但我没有看到。将不胜感激帮助。 $ connected基本上就是它如何连接到数据库(它确实起作用)
/*Starts creating the table to host the tasks */
echo "<table align='center' border='2px' style='width:1000px; line-height: 30px;'>";
echo "<tr>";
/* Names of table headers */
echo "<th> Task Name </th>";
echo "<th> Priority </th>";
echo "<th> Date Due </th>";
echo "<th> Comments </th>";
echo "</tr>";
$tasksquery = "SELECT * FROM tasks WHERE projectcode = '{$_GET['project']}'";
$tasksfinal = mysqli_query($connected, $tasksquery);
if ($tasksfinal) {
if (mysqli_num_rows($tasksfinal)) > 0 {
while($tablerows = mysqli_fetch_assoc($tasksfinal)) {
echo "<tr>";
echo "<td>" . $tablerows['name'] . "</td>";
echo "<td>" . $tablerows['priority'] . "</td>";
echo "<td>" . $tablerows['date'] . "</td>";
echo "<td>" . $tablerows['comments'] . "</td>";
echo "</tr>";
}
}
}
else {
echo "Error";
}