Jump to content

norus

New Members
  • Posts

    3
  • Joined

  • Last visited

norus's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I need some help with following WP query and insert. Query $arrAddress generates 1 record with address data from a 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 only 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 Means after insert, i get: 90, '3' => $arrAddress['first_name'] 90, '4' => $arrAddress['last_name'] 90, '5' => $arrAddress['gender'] 90, '6' => $arrAddress['street_address'] 90, '7' => $arrAddress['zipcode'] 90, '8' => $arrAddress['city'] 90, '9' => $arrAddress['country'] Hope someone of you with more experience then me can help me. Thanks in advance. print_r($arrAddress) output: 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 )
  2. I solved this with creating an extra table for addresses. The WP-usermeta table sucks. The idea of Guru was nice but not functional. WIth creating new table the insert + update is very easy and to get the data from the table is also better. Thanks for the reply.
  3. In WordPress I need a listing generated from table wp_usermeta which shows following results per row per user_id : user_id, city, first_name+ " "+lastname This is an example of the data in table wp_usermeta. 126 city Utrecht 126 last_name Huisman 126 first_name Fred 100 city Eibergen 100 last_name Van der Heide 100 first_name Toon 90 city Hengelo 90 last_name Klaver 90 first_name Gezien What I need is following result: 126 Utrecht Fred Huisman 100 Eibergen Toon Van der Heide 90 Hengelo Gezien Klaver Below script is wors. But it give you an idea of the table _ fields: SELECT wp_users.ID, wp_usermeta.meta_key , wp_usermeta.meta_value FROM wp_users INNER JOIN wp_usermeta ON wp_users.ID = wp_usermeta.user_id WHERE wp_usermeta.meta_key = "city" OR wp_usermeta.meta_key = "first_name" + "last_name" OR (wp_usermeta.meta_key = "lastwill_public" AND wp_usermeta.meta_value = "1") AND wp_usermeta.meta_value is null ORDER BY wp_users.ID DESC Who can help me getting the result. In advance thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.