Ho! =) There is such a code.

$wt=mysql_query("SELECT * FROM `table`); while($w=@mysql_fetch_array($wt)){ $wb = $w['zz']; } if ( $wb != '1'){ echo '<script> function refr() {setTimeout("document.location.reload()", 1000);} </script> <form onsubmit="refr();" action="" method="POST" target="_self"><input class="button-small" type="submit" name="sm" value="Press" /></form>';} if (isset($_POST['sm'])) { try { { Выполняем запрос в бд на добавление в поле zz значение 1 }}catch (Exception $e) { die("<p>Server error! Please contact the admin.</p>"); }} 

After that the page is updated, the value in the database is added, but the button disappears only when the page is re-updated.

How to solve a problem?

    1 answer 1

    Well, transfer the code if (isset ($ _ POST ['sm'])) above the sample code 'zz' from the table