Skip to main content

Custom registration field to SQL databasdatabase

I have created new columscolumns in a SQL table 'wp_users'called wp_users. Those fields are "giodo", "handel" and "regulamin".

What I want to do is to add '1' to each column when a user registers and selects corresponding checkboxes.

I added checkboxes to the form using form_register and then I added those checkboxes to user data with this (here is an example for only one of them):

        add_action('user_register', 'myplugin_user_register');
        function myplugin_user_register ($user_id) {
            if ( isset( $_POST['giodo'] ) )
            update_user_meta($user_id, 'giodo', $_POST['giodo']);
        }

Can I somehow add their values to the database?

Custom registration field to SQL databas

I have created new colums in a SQL table 'wp_users'. Those fields are "giodo", "handel" and "regulamin".

What I want to do is to add '1' to each column when a user registers and selects corresponding checkboxes.

I added checkboxes to the form using form_register and then I added those checkboxes to user data with this (here is an example for only one of them):

        add_action('user_register', 'myplugin_user_register');
        function myplugin_user_register ($user_id) {
            if ( isset( $_POST['giodo'] ) )
            update_user_meta($user_id, 'giodo', $_POST['giodo']);
        }

Can I somehow add their values to the database?

Custom registration field to SQL database

I have created new columns in a SQL table called wp_users. Those fields are "giodo", "handel" and "regulamin".

What I want to do is to add '1' to each column when a user registers and selects corresponding checkboxes.

I added checkboxes to the form using form_register and then I added those checkboxes to user data with this (here is an example for only one of them):

add_action('user_register', 'myplugin_user_register');
function myplugin_user_register ($user_id) {
    if ( isset( $_POST['giodo'] ) )
        update_user_meta($user_id, 'giodo', $_POST['giodo']);
}

Can I somehow add their values to the database?

Source Link
NakedCat
  • 189
  • 1
  • 2
  • 9

Custom registration field to SQL databas

I have created new colums in a SQL table 'wp_users'. Those fields are "giodo", "handel" and "regulamin".

What I want to do is to add '1' to each column when a user registers and selects corresponding checkboxes.

I added checkboxes to the form using form_register and then I added those checkboxes to user data with this (here is an example for only one of them):

        add_action('user_register', 'myplugin_user_register');
        function myplugin_user_register ($user_id) {
            if ( isset( $_POST['giodo'] ) )
            update_user_meta($user_id, 'giodo', $_POST['giodo']);
        }

Can I somehow add their values to the database?