Basically as it says in the question i am trying to take data from my database and have each row in the database display in a new row in a HTML table. I thought i was on the right track but when viewing my code in PhpStorm it throws up an error saying required parameter $query missing. I'm not sure where this parameter is meant to be but the error is showing up on the query line: $result = 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>