Is it considered best practice to use UPDATE statements after inserting values into tables with varying column numbers in PHP?

When dealing with tables with varying column numbers, it is considered best practice to use UPDATE statements after inserting values to ensure that all columns are properly updated. This approach allows for flexibility in handling different table structures and ensures that the data is accurately maintained.

// Assuming $conn is the database connection object

// Insert values into the table
$sql = "INSERT INTO table_name (column1, column2) VALUES ('value1', 'value2')";
$conn->query($sql);

// Update the inserted values
$sql = "UPDATE table_name SET column3 = 'value3' WHERE column1 = 'value1'";
$conn->query($sql);