Title: get more data
Last modified: April 6, 2019

---

# get more data

 *  [gransfor](https://wordpress.org/support/users/gransfor/)
 * (@gransfor)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/)
 * Hi, i want get current_user->display_name and user_email and id and etc in once
   field

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

 *  [supernova42](https://wordpress.org/support/users/supernova42/)
 * (@supernova42)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11398783)
 * You could always get them separately and concatenate them.
 *  Thread Starter [gransfor](https://wordpress.org/support/users/gransfor/)
 * (@gransfor)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399325)
 * i want output in once field separate by comma, for example : Joseph Campbell (
   name), 20 (old), New-York (city residences)
 *  [supernova42](https://wordpress.org/support/users/supernova42/)
 * (@supernova42)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399354)
 * For the attribute for that field you could add
    data-after::, Which would display
   a comma. However that only applies to the display of that field
 * To put all the data in one field you could do something like…
 * First create a field in pdp called ‘all_data’ or something like that.
    Then write
   some php. Download a php snippet plugin.
 *     ```
       <?php
       // Get all your required fields from WP
       $wp_user_id   = get_current_user_id();
       $current_user = wp_get_current_user();
       $wp_username  = $current_user->user_login;
       $wp_email     = $current_user->user_email;
       $wp_firstname = $current_user->user_firstname;
       $wp_lastname  = $current_user->user_lastname;
   
       $pdb_id=Participants_Db::get_record_id_by_term('username',$wp_username);
   
       //Now combine the data (Concatenate)
       $all_data=$wp_firstname.' '.$wp_lastname.', '.$wp_email.', '.$wp_user_id
   
       // This will display something like
       // Joseph Campbell, jocampbell@aol.com, 192
   
       //Now write the data to pdb
       data['all_data']=$all_data;
       $data = array();
       Participants_Db::write_participant($data,$pdb_id);
       ?>
       ```
   
 * You can then display this on the front end using
    echo $all_data;
 *  [supernova42](https://wordpress.org/support/users/supernova42/)
 * (@supernova42)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399361)
 * There are a few small errors such as $data for the array.
    also you create the
   field in pdb ‘Manage Database Fields’
 *  Thread Starter [gransfor](https://wordpress.org/support/users/gransfor/)
 * (@gransfor)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399474)
 * > There are a few small errors such as $data for the array.
 *  what with her make?
 *  Thread Starter [gransfor](https://wordpress.org/support/users/gransfor/)
 * (@gransfor)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399484)
 * and what stay in Default Value in field all_data?
 *  [supernova42](https://wordpress.org/support/users/supernova42/)
 * (@supernova42)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399487)
 * You don’t need anything in the default value. Leave it empty,
 *  Thread Starter [gransfor](https://wordpress.org/support/users/gransfor/)
 * (@gransfor)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399500)
 * > You can then display this on the front end using
   >  echo $all_data;
 * I want output this field in total table (pdb-list), dont und how me using echo,
   also
 * > There are a few small errors such as $data for the array.
   > what with her make?
 *  Code give error what there strange array
 *  [supernova42](https://wordpress.org/support/users/supernova42/)
 * (@supernova42)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399512)
 * You can output it using the shortcode
 * [pdb_list fields=”all_data,other fields etc”]
 *  [supernova42](https://wordpress.org/support/users/supernova42/)
 * (@supernova42)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399514)
 * $data[‘all_data’]=$all_data;
 *  Thread Starter [gransfor](https://wordpress.org/support/users/gransfor/)
 * (@gransfor)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399516)
 * > $data[‘all_data’]=$all_data;
 *  Still a mistake
 *  [supernova42](https://wordpress.org/support/users/supernova42/)
 * (@supernova42)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399527)
 * This is correct.
    Where are you entering the code? It’s php and you either have
   to enter it in a snippet, plugin or child theme.
 * If you use Wood Ad Snippets you can use the shortcodes
 * [insert_php]
 * $data = array();
    $data[‘all_data’]=$all_data; Participants_Db::write_participant(
   $data,$user_id);
 * php code goes here
 * [/insert_php]
 *  Thread Starter [gransfor](https://wordpress.org/support/users/gransfor/)
 * (@gransfor)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399538)
 * I download php snippet plugin
 *  Thread Starter [gransfor](https://wordpress.org/support/users/gransfor/)
 * (@gransfor)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399551)
 * > This is correct.
 *  you forgot to put ;
    -  This reply was modified 7 years, 1 month ago by [gransfor](https://wordpress.org/support/users/gransfor/).
 *  Thread Starter [gransfor](https://wordpress.org/support/users/gransfor/)
 * (@gransfor)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399728)
 * i make other way, write this code
 *     ```
       function stay_date_to_users() {
       global $wpdb;
       $current_user = wp_get_current_user();	
       $get_main_phone = $wpdb->get_var("SELECT phone FROM wp_participants_database WHERE id_private = '$current_user->id' "); // получает телефон компании
       $give_phone_to_users = $wpdb->query("UPDATE wp_users SET main_phone = '$get_main_phone' WHERE id = '$current_user->id'"); // даёт юзеру его телефон	
       $get_activity = $wpdb->get_var("SELECT activity FROM wp_participants_database WHERE id_private = '$current_user->id' "); // получает деятельность компании
       $give_activity = $wpdb->query("UPDATE wp_users SET activity = '$get_activity' WHERE id = '$current_user->id'"); // даёт юзеру его деятельность	
       $wpdb->query("UPDATE wp_users SET company = '$all_datas' WHERE id = '$current_user->id'"); // даёт юзеру его company	
       $wp_user_id   = get_current_user_id();
       $wp_username  = $current_user->user_login;
       $wp_email     = $current_user->user_email;
       $wp_main_phone = $current_user->main_phone;
       $wp_activity  = $current_user->activity;
       $wp_display_name  = $current_user->display_name;
       $all_datas = $wp_display_name.' '.$wp_main_phone.' '.$wp_email.' '.$wp_activity;	
       }
       stay_date_to_users();
       ```
   
 * but ‘$wpdb->query(“UPDATE wp_users SET company = ‘$all_datas’ WHERE id = ‘$current_user-
   >id'”);’ do not make update
    P.S all_data = current_user->company

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

The topic ‘get more data’ is closed to new replies.

 * ![](https://ps.w.org/participants-database/assets/icon-256x256.jpg?rev=1389807)
 * [Participants Database](https://wordpress.org/plugins/participants-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/participants-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/participants-database/)
 * [Active Topics](https://wordpress.org/support/plugin/participants-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/participants-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/participants-database/reviews/)

 * 15 replies
 * 2 participants
 * Last reply from: [gransfor](https://wordpress.org/support/users/gransfor/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/get-more-data/#post-11399728)
 * Status: not resolved