SyncViews Posted April 15, 2008 Share Posted April 15, 2008 tabel users user_id user_name ... tabel pms to from ... The id's from the pms (to and from) tabel match up with the users in the users tabel. I though about doing it like below but thats makes two rows for one pm but I only want one row SELECT users.user_id, users.user_name, pms.pm_id, pms.time, pms.content, pms.subject FROM users, pms WHERE pms.to = users.user_id OR pms.from = users.user_id is there someway I can make it just one row per pm with a result like this? pm_id time content subject to.user_id to.user_name from.user_id from.user_name Link to comment https://forums.phpfreaks.com/topic/101178-getting-this-in-one-queryresult/ Share on other sites More sharing options...
friedemann_bach Posted April 15, 2008 Share Posted April 15, 2008 What about adding "GROUP BY pms.pm_id" to your query? This should reduce all double entries to one. Link to comment https://forums.phpfreaks.com/topic/101178-getting-this-in-one-queryresult/#findComment-517555 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.