• Resolved supernova42

    (@supernova42)


    I run a php routine to get the users WordPress name.
    I then check to see if that user is on the PDB

    If the user is on the PDB I use
    do_shortcode(‘[pdb_record fields=”username,boat_name,boat_model,boat_owner” record_id=’.$user_id.’]’);
    which allows the user to amend his record

    If the user is not on PDB I use echo do_shortcode(‘[pdb_signup fields=”username”]’); to create a record with just the username. The shortcode requires the user to re-enter his username. The username is unique. To save this step, what code can I use for this routine to be carried out automatically and does not require the user to enter his username.

    Many Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter supernova42

    (@supernova42)

    Finally I’ve got it working. Initially the routine below was creating a new record but the username field was empty for some reason. I’m not sure if I had a typo, but it now works.

    $wp_username=’Enterprise’;
    $data=array(‘username’ => $wp_username);
    Participants_Db::write_participant($data);

    Thread Starter supernova42

    (@supernova42)

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Creating a new record with php’ is closed to new replies.