There is some way to do an Update in mysql where you only let update the data if the column is empty.
-
Imagine 4 input radio (the radios are marking 1 at a time)
-
If a user (x) chooses radio 1 and saves, and user (y) chooses radio 2 and saves
- What happens to the input radio 1 ???? the post comes empty consequently erasing the data in mysql and this I do not want to happen
Example
Data table
__________________________________________
| id | valor1 | valor2 | valor3 | Valor4 |
| 1 | 20 | | 20 | |
$valor1 = $_post['valor1']; //post vasio
$valor2 = $_post['valor2']; //post vasio
$valor3 = $_post['valor3']; //post vasio
$valor4 = $_post['valor4']; //post vasio
$sql = mysql_query ("INSERT INTO dados(valor1,valor2,valor3,valor4)
VALUES('$valor1','$valor2','$valor3','$valor4',)",
$conexao) or die( mysql_error());
se os post vierem vazios, vão apagar os dados que já estão na base
In the value1 column and value3 is entered values, I would like a way to lock those values and not to leave the