\n"; while ($row = mysql_fetch_array ($result)) { echo "$row[nick]$row[tekst]kustuta\n"; } echo ""; echo "LISA JUURDE"; } function kustuta($id) { global $db; $query = "DELETE FROM kohustused WHERE id=$id"; mysql_query ($query); $query2 = "DELETE FROM vastused WHERE tekst_id=$id"; mysql_query ($query2); echo "tagasi algusesse!"; } switch($_GET['action']) { case 'kustuta': kustuta($_GET['id']); break; default: index(); } ?>