save new data to wp_options non-post form

Load the existing option first and save the new data as an element in an array:

// get the option
$data = get_option( 'row_name' );
// add new data to the option
$data[] = $options;
// save it back to the db
update_option( 'row_name', $data );

Your option will then be an array of arrays instead of just a single array:

Array
(
    [0] => Array
        (
            [py_name] => username
            [address] => addy
            [coords] => results
        )
    [1] => Array
        (
            [py_name] => username
            [address] => addy
            [coords] => results
        )
)

Leave a Comment