0
votes
1answer
13 views

Update vs Insert logic but the last key is always inserted?

I have added a custom db table which looks like usermeta table, just storing some key - value pairs. But now i am stuck with the following logic a/ if key exist for a user use an update query else ...
0
votes
0answers
32 views

Custom query to update user meta data (also with a custom table)?

I have add a custom table (wp_shopping_metavalues) to the WP install which looks like wp_usermeta. I am displaying user values from both tables. For the insert i use function ...
1
vote
2answers
54 views

Select Multiple meta_value from WP DB; Single Query

I am trying to retrieve each user's first and last name, phone, email, and address from the usermeta table. I'm having trouble selecting multiple meta_values, each with its own meta_key, using a ...
0
votes
1answer
49 views

Minimize database queries to user tables?

I'm trying to come up with a strategic way to collect large amounts of usermeta data (and output to the screen) while keeping database queries low. Some pages, like the home page, single pages, and ...
0
votes
1answer
1k views

Select User by Joining Multiple Meta Value Results

( I would ask this in the general stack exchange forum but I think it is more relevant here. I'm intentionally using direct queries to the database here. ) I'm trying to select a group of users that ...
0
votes
3answers
169 views

custom user meta query

I've been trying to get this query to work but it keeps failing to return any rows SELECT a.ID FROM wp_users a, wp_usermeta b WHERE b.user_id=a.ID AND ( (b.meta_key='firstname-groom' AND ...
0
votes
2answers
87 views

list or get meta_key where meta_value is 'something'

I'm trying to get with get_user_meta the meta_key where the meta_value is 'ive-read-this' But I do not get the value. What should I do?
0
votes
1answer
140 views

Combining two meta_values within one row with query

I've added two new meta_keys to the wp_usermeta table: bid_user_lat and bid_user_lng And I need to be able to get both of these values within a single row, along with the user_id. ROW - (user_id) ...
0
votes
1answer
296 views

query usermeta from custom field

I am using a plugin to create custom fields in the user registration. I have created a check box field called g300 which is the name of the meta_key stored in wp_usermeta. It looks like the value ...
1
vote
2answers
2k views

mysql query two database tables, users and usermeta and sort by custom meta int value

I am trying to get an array of site users sorted by a custom meta value (an int). I can query the users just fine and get them back to use in a foreach. I currently have the query results come back ...