I have a table that is read in from a postgresql database. I am having trouble adding checkboxes to a final row in the table so that I can then, using an add to basket function pass items to a basket.php file.
Firstly I need to add a checkbox to a final column on each row so that I can check against the items I want to add when I click add to cart. I am struggling massively with this. Any help would be greatly appreciated as my code is below. If you could explain what needs to be done that'd be awesome as I can learn from it.
<table border="1">
<tr>
<th>ref</th>
<th>title</th>
<th>platform</th>
<th>description</th>
<th>price</th>
<th>select</th>
</tr>
<?php $resource = pg_query ($connect, "select refnumber,title,platform,description,price from csgames");
while ($a = pg_fetch_array ($resource)) {
echo "<tr>";
for ($j = 0; $j < pg_num_fields ($resource); $j++) {
echo "<td>".$a[$j] ."</td>";
}
echo "</tr>";
}
?>
</table>