0
votes
1answer
40 views

foreach loop inside the loop creating duplicates in output

I have a foreach loop inside the loop that is getting info from a separate table. The table has a column that has an id that reflects the id of the post type so it should always be unique. When I ...
3
votes
2answers
880 views

Display data from a non wordpress database on a page template

I am using a sql query to access information to display on a wordpress page by adding the below code to a page template. I know the query works as I've tested it in phpmyadmin. $rows = ...
0
votes
1answer
325 views

Can't seem to get set_blog_id working, it just doesn't reset the blog ID

Trying to iterate through a list of the sites and I can't seem to get set_blog_id working. Here's the sample output: Array ( [0] => stdClass Object ( [blog_id] => 2 ) [1] => stdClass Object ( ...
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 ...