I've come as far as this in my code:
<?php
include 'template/overall/header.php';?>
<div class="large-12 medium-12 columns">
<table width="60%" border="1" align="center">
<tr>
<th colspan="4"><label style="text-align: center"><b>Dina filer</b></label> <label style="text-align: center"><a href="ladda_fil.php"> Ladda upp en ny fil</a></label></th>
</tr>
<tr>
<td>Fil Namn</td>
<td>Fil Typ</td>
<td>Fil Storlek(KB)</td>
<td>Öppna</td>
<td>Radera</td>
</tr>
<?php
$sql="SELECT * FROM file LEFT JOIN users on userName";
$result_set=mysql_query($sql);
if($result_set === FALSE) {
die(mysql_error()); // TODO: better error handling
}
while($row=mysql_fetch_array($result_set))
{
?>
<form action="" method="POST">
<tr>
<td><?php echo $row['file'] ?></td>
<td><?php echo $row['type'] ?></td>
<td><?php echo $row['size'] ?></td>
<td><a href="filer/mina_filer/<?php echo $row['file'] ?>" target="_blank">Öppna fil</a></td>
<td style="text-align: center; padding-top: 10px"><input name="delete" type="checkbox"></td>
</tr>
<?php
}
?>
</table>
<input type="submit" class="button" value="Radera filer" style="float: right; margin-right: 20%; padding: 0.7%; color: black; font-style: italic; font-size: 80%">
</form>
</div>
<?php
if (isset($_POST['delete'])) {
$sql = "DELETE * FROM file WHERE";
mysql_query($sql);
}
include 'template/overall/footer.php';
?>
Where do I go from here? This is a start to deleting from database but it's not working. I'm new to php and trying to figure this out. Any help is appreciated!