I don't know if what I want to do is possible (or too complicated).
I have a form that inserts the data into my DB. In it I have a select. I want to hide or remove the options that are already in my DB (so the user can't see them).
Every user has his own .php page where I edit the form with new options after the old ones are used.
PHP (In the same page, above the form):
<?php
if ($registro != "") {
include("conexao.php");
$conexao = @mysql_connect($host,$user,$pass)
or die("Cadastro");
$query = "INSERT INTO certificados VALUES ('$id','$registro','$name', now() )";
mysql_select_db($db);
mysql_query($query,$conexao);
}
else {
?>
HTML:
<form name="inserir" action="<? echo $PHP_SELF; ?>" method="post">
<select name="registro" id="registro">
<option value="">Select one</option>
<option value="11891">11891</option>
<option value="11892">11892</option>
<option value="11893">11893</option>
<option value="11894">11894</option>
<option value="11895">11895</option>
</select>
<input type="text" name="name" placeholder="Name">
<button type="submit" id="submit" name="B3">Send</button>
</form>
Edit 1: I'll try to explain better what I want to do.
Imagine that the user selected the first option value "11891" and submitted the form (thus inserting this value in the DB). After the page reloads, this value is no longer listed for him in the select. So based on the form that I posted here, now he would only have the options "11892", "11893", "11894" and "11895".
PS: Sorry for any mistakes or use of outdated parameters. My father wrote this code (he has some knowledge of php). In my case, my knowledge is almost nonexistent.
Thank you all for the help.