Select query from custom tables in Wordpress
Briefly

The current approach in the provided code fetches and displays details only for the last client assigned to a project, due to overwriting variables within the loop. To properly display all clients linked to the same project, it's necessary to collect and accumulate each client's details in an array or an object, allowing you to present a complete list after the iterations are fully processed.
The current loop structure only allows for display of one client's details per project because the inner loop overwrites any previously fetched user data.
To display all clients assigned to a single project, you must restructure your data handling to aggregate clients without losing previous entries.
Read at SitePoint Forums | Web Development & Design Community
[
|
]