wordpress table insert with multiple rows out of 1 record

I need some help with following WP query and insert. Query $arrAddress generates 1 record with address data from an address table. That works fine.

Second query check if $user_id is present in testament table. If not present it must insert the data from address table into testament table.

I do not know how to get the address data into table testament. Each address must get a record in testament table. Fields in wp_mm_testament are: userid, field_id, field_value

$arrAddress = $GLOBALS['wpdb']->get_row('SELECT * FROM wp_mm_users_address WHERE user_id = "'.$user_id.'" ');

$arrTestament = $GLOBALS['wpdb']->get_row('SELECT userid FROM wp_mm_testament WHERE userid = "'.$user_id.'" ');

if(count($arrTestament) == 0) { // fields in wp_mm_testament are: userid, field_id, field_value

if(count($arrAddress) > 0) { // wp_mm_users_address has address of user $user_id

['wpdb']->insert('wp_mm_testament', array(

here is the problem to solve



print_r($arrAddress) result:

stdClass Object ( [id] => 3 [user_id] => 100 [gender] => m [first_name] => Meindert Hendrik [last_name] => Heide Groot [street_address] => Huizenbrink 12 [zipcode] => 8929GH [city] => Eibergen [country] => Nederland )

Task: write me how to get $arrAddress data into wp_mm_testament.

Result of insert() in table wp_mm_testament. is then:

userid, field_id, field_value

3, '3' => $arrAddress['first_name'],

3, '4' => $arrAddress['last_name'],

3, '5' => $arrAddress['gender'],

3, '6' => $arrAddress['street_address'],

3, '7' => $arrAddress['zipcode'],

3, '8' => $arrAddress['city'],

3, '9' => $arrAddress['country']

Realisation: today

I only need how to insert the result into table wp_mm_testament. with ['wpdb']->insert('wp_mm_testament'

Evner: PHP, Software Arkitektur

Se mere: insert record multiple table jsp form, insert table xml record, insert table wordpress page, multiple column posts wordpress, insert video wordpress plugin, display mysql rows php link full table, access table wordpress, aspnet html form insert table, insert table lost connection mysql server query, insert video wordpress

Om arbejdsgiveren:
( 30 bedømmelser ) Enschede, Netherlands

Projekt ID: #8291318

Tildelt til:


Hi, please provide the access details for the control panel to check this issue because we need to have a look on the other db tables Regards,

$8 USD / time
(254 bedømmelser)

12 freelancere byder i gennemsnit $14/time for dette job


Hi, I have read your post and understood your requirement. I have great experience in handling /PHP/MySQL/HTML5/jQuery/Wordpress/Magento/Joomla/Drupal/AngularJS/node.js/CSS3/Java/Python/Django/Javascript/iOS/Andr Flere

$25 USD / time
(83 bedømmelser)

Hi I have gone through the details of your project and we find it well within our capabilities. I offer a wide range of services, including Web design, PHP/MySQL web application development, Open sources like Joo Flere

$8 USD / time
(352 bedømmelser)

I want to discuss this project with you further, let me know the best suitable time for you to schedule the meeting, Feel free to message me at any time, i used to be online 14 hrs in a day on this website so probably Flere

$20 USD / time
(39 bedømmelser)

Dear Client, Greetings!! We are WordPress Experts, can do anything in WordPress Custom extensions development as well as setup a complete web shop with all versions. We will assist you to revise your existing Woo Flere

$8 USD / time
(44 bedømmelser)

Dear Sir, I am really interested to work on this project . I have very good experience of doing this sort of job, I can start the work now and can assure the best service from my end. I am waiting here to discuss Flere

$20 USD / time
(88 bedømmelser)

Hello , I have read your project details and requirements very carefully and I am very much confident that I can do it in time.. Please talk to me and give me a little chance. Thank You...

$8 USD / time
(36 bedømmelser)

Hello Sir, Greeting for the day, Hope you are doing well We are Group of professional having more than 8 years’ experience in Windows/Linux Server administration , Website Hosting (Cpanel/Plesk) migration, Mail ser Flere

$15 USD / time
(24 bedømmelser)

Get Professional & Creative website that help your business to grow.I am an expert web designer and developer, capable of developing any type of website. I can develop from a standard website to a complete online stor Flere

$15 USD / time
(11 bedømmelser)

Hello! I am from Nagpur, India. So what you need is to extract the data from the table and put it into the second table. Message me so that I can understand your task correctly...

$16 USD / time
(1 bedømmelse)

Hello, As I have seen your Job Post I am ready to work. I am having extensive experience in WordPress development. * Custom Responsive Design * Theme customization * W3C validation * Site Optimization Flere

$8 USD / time
(0 bedømmelser)

A proposal has not yet been provided

$12 USD / time
(0 bedømmelser)