I have a table filled with data from data base submitted through a form. Every time I add some info in the form, this will be displayed in the table below. At the end of each row is a button, say, "delete". If any button is pressed, the respective row is deleted including from the data base.
echo "<table>"
while($date=mysql_fetch_assoc($q))//$q is select * from table
{
echo "<tr><td>{$date['id']}</td><td>{$date['nume']}</td><td>{$date['prenume']}</td><td>{$date['adresa']}</td><td>{$date['datan']}</td><td>{$date['fumator']}</td><form method=\"post\"><td><input type=\"hidden\" name=\"id\" value='{$date['id']}'><input type=\"submit\" name=\"sterge\" value=\"sterge\"></td></form></tr>";
}
echo "</table>";
if(isset($_POST['sterge'])) echo "'sterge' was pressed but also the row was deleted. why?!";
No other queries attached to if(isset). Just wanted to see what happens if I press any button and I don't understand why is this happening.