Supposing I have an existing table(already created in dB) that handles user-registration (a plugin) and insert data using the $wpdB->insert like this:
$success = $wpdb->insert(
$wpdb->mytable,
array(
'first_name' => $first_name,
'last_name' => $last_name,
'email' => $email,
'activation_key' => $activation_key,
), array('%s', '%s', '%s', '%s')
);
Now my problem is I want to add another field to my existing table in dB. This field should have also have its own data. What would be the best practice to handle this type of situation? Do $wpdB->insert class creates a column automatically if its not there in the dB? For example, supposing I would like to add a hobby field name in the insert:
$success = $wpdb->insert(
$wpdb->mytable,
array(
'first_name' => $first_name,
'last_name' => $last_name,
'email' => $email,
'hobby' => $hobby,
'activation_key' => $activation_key,
), array('%s', '%s', '%s', '%s')
);
Would the "hobby" data be automatically inserted to the dB with a new column? If not, what would be the simplest and recommended method in doing this? Thanks for any help.