\n"; while ($row = mysql_fetch_array ($result)) { echo "$row[nick]$row[tekst]vastused\n"; } echo ""; } function vastused($id) { global $db; $query = "SELECT * FROM vastused WHERE tekst_id=$id"; $result = mysql_query ($query); echo "\n"; while ($row = mysql_fetch_array ($result)) { echo ""; echo "
"; } echo "
$row[vastus]
"; echo "
"; echo "
\n"; echo "
\n"; echo "\n"; } function lisavastus($id) { global $db; $query = "INSERT INTO vastused VALUES('',$id,'{$_POST['vastus']}')"; mysql_query($query); echo "Tagasi\n"; } switch($_GET['action']) { case 'vastused': vastused($_GET['id']); break; case 'lisavastus': lisavastus($_GET['id']); break; default: index(); } ?>