I want to insert a data in a specific column and not have to select all the columns, we see camp1, camp2, camp3... Where I am only going to insert it in camp3
What I can do?
$data_table = mysqli_query($file,"INSERT INTO $table (camp1,camp2,camp3,...) VALUES ('$data','','')");
Assuming that the other fields "allow" nulls and that your original statement is correct, it should look something like this:
(You must still indicate the field of the value that you are going to insert).
There are several options to insert a new value
Your current code has each column declared with a corresponding value:
But to insert values there are more variants:
Option 1 : Insert only values without detailing columns , the values go in column order:
Option 2 : Insert values only in some columns, but in this case you need to detail which columns you will use to assign the values:
or also a single column:
I hope you find it useful. Greetings.