基本上,因为它在这个问题说,我想从我的数据库获取数据,并在数据库中显示每行中的HTML表中的新行。 我以为我是在正确的轨道上,但在PhpStorm看我的代码时,它抛出了一个错误,说需要的参数$查询失踪。 我不知道在这个参数的意思是,但错误显示出来的查询行:$结果= mysqli_query(....
<table cellpadding="0" cellspacing="0" width="100%" class="sortable">
<thead>
<tr>
<th>Project title</th>
<th>Start Date</th>
<th>Acc Manager</th>
<th>Designer</th>
<th>Stage</th>
<td> </td>
</tr>
</thead>
<tbody>
<?php
function list_projects() {
global $connection;
$output = "";
$result = mysqli_query("SELECT * FROM projects ORDER BY project_title ASC");
while ($row = mysqli_fetch_array($result)){
$output .= '
<tr>
<td>' . $row['project_title'] . '</td>
<td>' . $row['start_date'] . '</td>
<td>' . $row['acc_manager'] . '</td>
<td>' . $row['designer'] . '</td>
<td>' . $row['stage'] . '</td>
</tr>';
}
return $output;
}
?>
</tbody>
</table>