mysql_query("DELETE FROM topics WHERE id = '".$delete."' AND naam = '".$naam."'") or die(mysql_error());
$sql = mysql_query("SELECT id FROM topicreacties WHERE topicid='".$delete."'") or die(mysql_error());
while($assoc = mysql_fetch_assoc($sql)) {
mysql_query("DELETE FROM topicreacties WHERE id = '".$assoc['id']."'") or die(mysql_error());
}
mysql_query("DELETE FROM topics WHERE id = '".$delete."' AND naam = '".$naam."'") or die(mysql_error());